Using the sys module

Import module sys

import sys

sys.argv command line parameters List, when the first element of the program itself path

sys.exit (n) to exit the program, when the normal exit exit (0)    

sys.version get python interpreter version information

int sys.maxint maximum value (used only for python2)

int sys.maxsize maximum value (used only to python3) 

sys.path return path search module, using the value of environment variable initialization PYTHONPATH  

sys.platform return the name of the operating system platform

sys.stdout Linux in everything is a file (_io (file read and write operations))

Examples sys.stdout.write ( 'please') standard output lead progress bar, output please6. 6 characters in length

sys.stdin.read () has been read data, the standard input

sys.stdin.readline () to read a line, the standard input   

sys.getrecursionlimit () Gets the maximum recursion layers (the default maximum 1000)

sys.setrecursionlimit (1200) set the maximum recursion layers

sys.getdefaultencoding () Gets the default encoding interpreter

sys.getfilesystemencoding () Gets save memory data to a file in the default encoding

 

Guess you like

Origin www.cnblogs.com/Kevin-kong/p/10958548.html