Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 3, 2021 04:58 pm GMT

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



  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.


Original Link: https://dev.to/expoashish/complete-guide-for-os-module-in-python-every-developer-should-know-1f7a

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To