First page Back Continue Last page Overview Graphics

The os Module

A unified interface for OS routines for Mac, NT, or Posix depending on what system we're on.

os.chdir(path) Change to another directory

os.getcwd() the complete path of the current working

directory

os.listdir() list of all files and directories in the

current directory

os.rename(src,dst) renames src to dst

os.remove(file) removes file

os.removedirs(path) a directory gets recursively removed

os.system(command) execute command in shell