sys module

The sys module provides access to variables used or maintained by the interpreter and functions that interact with the interpreter.

The os module is responsible for the interaction between the program and the operating system (providing an interface to access the bottom layer of the operating system); the sys module is responsible for the interaction between the program and the python interpreter (providing a series of functions and variables to manipulate the python runtime environment).

 

sys.argv: Implement passing parameters to the program from outside the program (the first parameter is always the file name)

sys.exit(n) : Execute to the end of the main program, the interpreter automatically exits, if you need to exit halfway, call the sys.exit function.

sys.path : a string collection of search paths when getting the specified module sys.path.append("custom module path")

 

Guess you like

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