Python-Os Blog Posts

Basics of Python OS module

OS module provides a lot of functions to interact with Operating System which can handle files, processes and environment paths and many more.
If you are planning to automate some tasks in your server which handle paths, system variables OS module is the best option because of platform independence.
OS module is platform independent, you can write the script in any machine (Linux, Windows etc.) and you can execute the same script for the same functionality in other machines also if the code is not platform independent.
If you want to list down all functions for OS modules you can directly go through the official documentation page of python i.e https://docs.python.org/2/library/os.html.
Here I will discuss some of the functions which I use most of the time.
For any module in python, the first thing is you need to import it, and you can import os modules as below.
import os

1 Likes 257 Views