Python base (27) - review sys, os

sys module Review

sys.argv path is mainly used to display the program execution when the parameter is added in the back, Riga script commands, may be performed directly in front of the path

sys.version Python version information

sys.platform platform

When you do a search path environment variable sys.path program, usually append method to add paths

sys.stdin sys.stdout sys.stderror input and output, input with the alternative

OS module Review

os.getcwd current directory

os.chdir Change directory

os.curdir return to the current directory

os.mkdir build directory

os.rmdir delete directory

os.listdir directory listing

os.remove deleted files

os.rename renamed

os.stat file details

os.sep path separator

os.linesep each row delimiter

os.pathsep string path separator

os.name system name  

 

Guess you like

Origin www.cnblogs.com/dayouge/p/11208736.html