python --module-sys

sys.argv command line parameter list, the first element is the path of the program itself
sys.exit(n) exit the program, exit(0) when exiting normally
sys.version Get the version information of the Python interpreter
sys.maxint maximum Int value
sys.path returns the search path of the module, using the value of the PYTHONPATH environment variable during initialization
sys.platform returns the OS platform name
sys.stdout.write( ' please: ' )   #Standard output, an example of eliciting a progress bar, note, it doesn't work on py3, you can use print instead of 
val = sys.stdin.readline()[:-1] #Standard input 
sys .getrecursionlimit() #Get the maximum number of recursion levels 
sys.setrecursionlimit(1200) #Set the maximum number of recursion levels 
sys.getdefaultencoding()   #Get the default encoding of the interpreter 
sys.getfilesystemencoding #Get   the default encoding of the memory data stored in the file

import sys

>>> sys.argv
['']

>>> sys.version
'3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]'

>>> sys.maxsize
9223372036854775807

>>> sys.path
['', 'E:\\anaconda3\\python36.zip', 'E:\\anaconda3\\DLLs', 'E:\\anaconda3\\lib', 'E:\\anaconda3', 'E:\\anaconda3\\lib\\site-packages', 'E:\\anaconda3\\lib\\site-packages\\win32', 'E:\\anaconda3\\lib\\site-packages\\win32\\lib', 'E:\\anaconda3\\lib\\site-packages\\Pythonwin']

>>> sys.platform
'win32'

>>> sys.stdout
<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>

>>> sys.stdout.write('hey3')
hey34

>>> sys.stdout.write('hey3sdf')
hey3sdf7
#This is the standard output

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324732604&siteId=291194637