diff options
author | R. David Murray <rdmurray@bitdance.com> | 2010-12-17 16:11:40 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2010-12-17 16:11:40 (GMT) |
commit | a396463db3c6e3f06cdba37395c1aa4a99ebf6fb (patch) | |
tree | e63795115f232dbf64616c580e9c5b8dc68b90f1 | |
parent | dca5b862338034460e060cedee8ba788073e20b3 (diff) | |
download | cpython-a396463db3c6e3f06cdba37395c1aa4a99ebf6fb.zip cpython-a396463db3c6e3f06cdba37395c1aa4a99ebf6fb.tar.gz cpython-a396463db3c6e3f06cdba37395c1aa4a99ebf6fb.tar.bz2 |
#10559: provide instructions for accessing sys.argv when first mentioned.
-rw-r--r-- | Doc/tutorial/interpreter.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst index f397f03..20fae9a 100644 --- a/Doc/tutorial/interpreter.rst +++ b/Doc/tutorial/interpreter.rst @@ -78,8 +78,9 @@ Argument Passing ---------------- 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 -list of strings. Its length is at least one; when no script and no arguments +thereafter are turned into a list of strings and assigned to the ``argv`` +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 ``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When :option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When |