Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a396463

Browse files
committed
#10559: provide instructions for accessing sys.argv when first mentioned.
1 parent dca5b86 commit a396463

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/tutorial/interpreter.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ Argument Passing
7878
----------------
7979

8080
When known to the interpreter, the script name and additional arguments
81-
thereafter are passed to the script in the variable ``sys.argv``, which is a
82-
list of strings. Its length is at least one; when no script and no arguments
81+
thereafter are turned into a list of strings and assigned to the ``argv``
82+
variable in the ``sys`` module. You can access this list by executing ``import
83+
sys``. The length of the list is at least one; when no script and no arguments
8384
are given, ``sys.argv[0]`` is an empty string. When the script name is given as
8485
``'-'`` (meaning standard input), ``sys.argv[0]`` is set to ``'-'``. When
8586
:option:`-c` *command* is used, ``sys.argv[0]`` is set to ``'-c'``. When

0 commit comments

Comments
 (0)