An Interest In:
Web News this Week
- May 1, 2024
- April 30, 2024
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
May 3, 2021 04:58 pm GMT
Original Link: https://dev.to/expoashish/complete-guide-for-os-module-in-python-every-developer-should-know-1f7a
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 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
- 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)
- 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.
Original Link: https://dev.to/expoashish/complete-guide-for-os-module-in-python-every-developer-should-know-1f7a
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To