本文大量内容来源于沈老师的简明python教程和python官方的解释文档https://docs.python.org/3/library/sys.html,其中夹杂部分个人的理解如有偏颇之处还望海涵。
简介
\quad Python标准库是随Python附带安装的,它包含大量极其有用的模块。熟悉Python标准库是十分 重要的,因为如果你熟悉这些库中的模块,那么你的大多数问题都可以简单快捷地使用它们来解决。
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.
sys.argv
The list of command line arguments passed to a Python script.
argv[0] is the script name (it is operating system dependent whether
this is a full pathname or not). If the command was executed using the
-c command line option to the interpreter, argv[0] is set to the string ‘-c’. If no script name was passed to the Python interpreter,
argv[0] is the empty string.
传递给Python脚本的命令行参数列表。
argv [0]是脚本名称(无论这是否是完整路径名,它依赖于操作系统)。 如果使用解释器的-c命令行选项执行命令,则将argv [0]设置为字符串’-c’。 如果没有脚本名称传递给Python解释器,则ar