OS Module Common Functions

OS Module Common Functions

  • OS module provides some callable methods and some variables. Some of the common methods for different functional categories are:

Manipulating directories: 

  • chdir()
  • getcwd()
  • listdir()
  • mkdir()
  • makedirs()
  • rmdir()
  • removedirs()

Removing a file:

  • remove()

Renaming files/directories:

  • rename() 

Using more than one process:

  • system()
  • popen()
  • close()
  • walk()

User id and process id:

  • getgid(), os.getuid(), os.getpid()

More about directories and files:

  • error
  • stat()

Cross-platform os attributes:

  • name

Accessing environment variables:

  • environ

Common Functions 

  • os.name
  • os.error
  • os.system()
  • os.getcwd
  • os.chdir()
  • os.listdir()
  • os.popen
  • os.close()

 

 


 


 

 

Comments