summaryrefslogtreecommitdiff
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-12-17 16:11:40 +0000
committerR. David Murray <rdmurray@bitdance.com>2010-12-17 16:11:40 +0000
commitaa162946c255762b65d0b76a1cf3ee2d997f9839 (patch)
tree100cd219a43c3a06ef94a4c2a63e495ba0bbe75d /Doc/tutorial
parent587e74b9edbf5251cfd05f64db141e9a1dfedf12 (diff)
downloadcpython-aa162946c255762b65d0b76a1cf3ee2d997f9839.tar.gz
#10559: provide instructions for accessing sys.argv when first mentioned.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/interpreter.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
index f397f032eb..20fae9ac26 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