Skip to content

Commit 7502af8

Browse files
authored
Tutorial sys.argv example should not have interactive prompt (GH-94880)
1 parent 3789c63 commit 7502af8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Doc/tutorial/stdlib.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ Command Line Arguments
6565

6666
Common utility scripts often need to process command line arguments. These
6767
arguments are stored in the :mod:`sys` module's *argv* attribute as a list. For
68-
instance the following output results from running ``python demo.py one two
69-
three`` at the command line::
68+
instance, let's take the following :file:`demo.py` file::
69+
70+
# File demo.py
71+
import sys
72+
print(sys.argv)
73+
74+
Here is the output from running ``python demo.py one two three`` at the command
75+
line::
7076

71-
>>> import sys
72-
>>> print(sys.argv)
7377
['demo.py', 'one', 'two', 'three']
7478

7579
The :mod:`argparse` module provides a more sophisticated mechanism to process

0 commit comments

Comments
 (0)