sys module VS OS module

A, sys module

  --sys module, which provides a number of functions and variables, so that some of the information we can get python parser, on behalf of the python parser operation

  Common operations:

    The introduction of import sys;

    All current program module properties sys.modules introduced, returns a dictionary module name {:} module object;

    Function sys.exit (print [information]) indicates to exit the current program;

    Python sys.path is saved properties built and custom module search path, it returns a list.

Two, os module

  - operating system modules can be accessed through the computer's operating system module

  - the os.system function ( 'the operating system's command'), for example: os.system ( 'dir')

  - Property os.enrivon return system environment variables, an ancestral    

Guess you like

Origin www.cnblogs.com/henji1266/p/12005508.html