Kaydet (Commit) a396463d authored tarafından R. David Murray's avatar R. David Murray

#10559: provide instructions for accessing sys.argv when first mentioned.

üst dca5b862
...@@ -78,8 +78,9 @@ Argument Passing ...@@ -78,8 +78,9 @@ Argument Passing
---------------- ----------------
When known to the interpreter, the script name and additional arguments When known to the interpreter, the script name and additional arguments
thereafter are passed to the script in the variable ``sys.argv``, which is a thereafter are turned into a list of strings and assigned to the ``argv``
list of strings. Its length is at least one; when no script and no arguments variable in the ``sys`` module. You can access this list by executing ``import
sys``. The length of the list is at least one; when no script and no arguments
are given, ``sys.argv[0]`` is an empty string. When the script name is given as are given, ``sys.argv[0]`` is an empty string. When the script name is given as
``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When ``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When
:option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When :option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment