[Python Advanced Tutorial 24] os module

insert image description here

In Python, osa 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. osModules are very powerful and can be used for many operating system related tasks. Here are some oscommonly 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

Guess you like

Origin blog.csdn.net/m0_47256162/article/details/132162617