Sys.version get version information for Python interpreter
>>> sys.version ' 2.7.12 (default, Dec 4, 14:50:18) \N[GCC 5.4.0 20160609] '
Sys.platform returns the operating system platform name
>>> sys.platform ' linux2 '
Sys.getrecursionlimit () #获取最大递归层数
>>> Sys.getrecursionlimit () 1000
Sys.setrecursionlimit () #设置最大递归层数
>>> sys.setrecursionlimit () >>> sys.getrecursionlimit () 5000
Sys.getdefaultencoding () #获取解释器默认编码
>>> sys.getdefaultencoding () ' ASCII '
Sys.getfilesystemencoding () #获取内存数据存到文件里的默认编码
>>> sys.getfilesystemencoding () ' UTF-8 '
Sys.maxint the largest int value
>>> sys.maxint9223372036854775807
Sys.maxsize in Python3
>>> sys.maxsize9223372036854775807
Sys.path returns the search path for the module, using the value of the PYTHONPATH environment variable when initializing
>>> sys.path[', '/usr/lib/python35.zip ', '/usr/lib/python3.5 ', '/usr/lib/python3.5/plat-x86_64-linux-gnu ', '/usr/lib/python3.5/lib-dynload ', '/home/sch01ar/.local/lib/python3.5/site-packages ', '/usr/local/lib/ Python3.5/dist-packages ', '/usr/lib/python3/dist-packages ']
SYS.ARGV command-line argument list, the first element is the path of the program itself
Import sysif sys.argv: print (SYS.ARGV)
Run results
Sys.exit (n) exit program, Exit normally (0)
Import sysprint (' sys test ') sys.exit (0) print (' a ')
Run results
Sys.exit () adds a parameter to print before exiting the program
Import sysprint (' sys test ') sys.exit (' Python would exit ')
Run results
Sys.exit () for exiting in the main thread, Os._exit () for exiting in thread
Sys.stdin.readline () standard input
>>> sys.stdin.readline () python ' python\n '
Sys.stdout.write () Standard output
Import syssys.stdout.write (' python\n ')
Run results
Python Module-sys module