The Python interpreter interacts with the interface
sys.argv
- Command line arguments list, the first element is the path of the program itself
defpost ():Print('post ...')defDownload ():Print('Download ...')ifsys.argv[1]=='Post': Post ()elifsys.argv[1]=='Download': Download ()#cmd, python sys module. PY Post >>>post ...
Sys.exit (N)
- Exit the program, exit normally (0)
Sys.version
- Get version information for Python interpreter
Sys.maxint
Sys.path
- Returns the search path for the module, using the value of the PYTHONPATH environment variable when initializing
Import Time Print (Sys.path) sys.path.append () # Find the time module path, if you write the module, you need to add a path
Sys.platform
Import Sys,os if ' Win32 ' : os.system ('dir')else: os.system ( 'ls')
- Returns the operating system platform name, cross-platform
Sys.stdout.write (' please: ')
val = Sys.stdin.readline () [:-1]
Python basic Syntax-SYS module