os is a core Python module that allows exposure of OS-specific tasks.

Contains... Edit

  • os.error - an alias for the OSError exception
  • - the registered name of the OS. For example: 'posix'
  • os.environ - the environment that Python interpreter currently sees. This object is like a dict. Setting will call 'putenv'
  • os.chdir(path), os.fchdir(fd), os.getcwd() - current directory functions. chdir CHanges DIRectory, getcwd GETs Current Working Directory and fchdir changes to the direct that the file that is specified by the fd is in
  • or.urandom(n) - Generates a random string of bytes, n digits long. Unlike random.randint, it is completely random; not pseudorandom.
  • os.system(command) - Executes a CMD command.

This is a short article. Please extend it!