The getopts command returns true if an option is found, so a common option processing paradigm uses a while loop with a case statement as in this example.
如果找到一个选项,则getopts命令返回true,因此常见的选项处理范例使用带case语句的while 循环,本例中就是如此。
Options found after -c command or -m module are not consumed by the Python interpreter's option processing but left in sys. argv for the command or module to handle.
在- c命令或- m模块之后的选项不会经由Python解释器的选项处理,但会保留在sys .argv中由命令或模块来处理。
Options found after -c command or -m module are not consumed by the Python interpreter's option processing but left in sys. argv for the command or module to handle.
在- c命令或- m模块之后的选项不会经由Python解释器的选项处理,但会保留在sys .argv中由命令或模块来处理。
应用推荐