Complete Guide for OS Module in Python Every Developer should know

Introduction to Python OS Module: The OS module in Python provides functions for interacting with the operating system. It offers many useful OS functions that are used to perform OS-based tasks and get related information about operating system. The O…


This content originally appeared on DEV Community and was authored by Ashish Yadav

Introduction to Python OS Module: The OS module in Python provides functions for interacting with the operating system. It offers many useful OS functions that are used to perform OS-based tasks and get related information about operating system. The OS comes under Python's standard utility modules. Lets Start:-

To work with the OS module, we need to import the OS module:

import os



  1. os.name:

This function gives the name of the operating system dependent module imported. The following names have currently been registered: ‘posix’, ‘nt’, ‘os2’, ‘ce’, ‘java’ and ‘riscos’

Code:

import os
print(os.name)



  1. os.mkdir() :

This function is used to create new directory.

Code:

import os
print(os.mkdir(path))




For Continue Reading->

???AND Subscribe to Our YouTube Channel bestcodecreator

???AND Support Our Blogging site myblogs

Conclusion:

Thank you for reading this blog. I wish you the best in your journey in learning and mastering in Python Programming??.


This content originally appeared on DEV Community and was authored by Ashish Yadav


Print Share Comment Cite Upload Translate Updates
APA

Ashish Yadav | Sciencx (2021-05-03T16:58:50+00:00) Complete Guide for OS Module in Python Every Developer should know. Retrieved from https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/

MLA
" » Complete Guide for OS Module in Python Every Developer should know." Ashish Yadav | Sciencx - Monday May 3, 2021, https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/
HARVARD
Ashish Yadav | Sciencx Monday May 3, 2021 » Complete Guide for OS Module in Python Every Developer should know., viewed ,<https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/>
VANCOUVER
Ashish Yadav | Sciencx - » Complete Guide for OS Module in Python Every Developer should know. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/
CHICAGO
" » Complete Guide for OS Module in Python Every Developer should know." Ashish Yadav | Sciencx - Accessed . https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/
IEEE
" » Complete Guide for OS Module in Python Every Developer should know." Ashish Yadav | Sciencx [Online]. Available: https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/. [Accessed: ]
rf:citation
» Complete Guide for OS Module in Python Every Developer should know | Ashish Yadav | Sciencx | https://www.scien.cx/2021/05/03/complete-guide-for-os-module-in-python-every-developer-should-know/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.