Article directory
In Python, os
a module is a built-in module used to interact with the operating system. It provides many methods to access the functionality of the operating system, such as file and directory operations, process management, environment variable access, etc. os
Modules are very powerful and can be used for many operating system related tasks. Here are some os
commonly used functions of modules:
1. File and directory operations
os.listdir(path)
: Get a list of files and directories under the specified path.os.getcwd()
: Get the current working directory.os.chdir(path)
: Change the current working directory.os.mkdi