標籤:use main ESS 操作 lis this fun not over
- sys: This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. 參見:https://docs.python.org/3/library/sys.html
- os:This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see
open(), if you want to manipulate paths, see the os.path module, and if you want to read all the lines in all the files on the command line see the fileinput module. For creating temporary files and directories see the tempfile module, and for high-level file and directory handling see the shutil module. 參見:https://docs.python.org/3/library/os.html
通俗地來說:
- sys用於利用Python編譯器的一些變數或函數來完成任務。
- os用於利用作業系統的一些變數和函數(大多經過了重新命名以提高可移植性)來達到目的。
Python中sys和os模組的區別