Skip to content

Commit 29fc4bf

Browse files
committed
Use the platform-independent way of calling a script from the shell: "python prog.py", not "prog.py"
Found by Micheal Wells on docs@.
1 parent 136a050 commit 29fc4bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/argparse.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ produces either the sum or the max::
4646
Assuming the Python code above is saved into a file called ``prog.py``, it can
4747
be run at the command line and provides useful help messages::
4848

49-
$ prog.py -h
49+
$ python prog.py -h
5050
usage: prog.py [-h] [--sum] N [N ...]
5151

5252
Process some integers.
@@ -61,15 +61,15 @@ be run at the command line and provides useful help messages::
6161
When run with the appropriate arguments, it prints either the sum or the max of
6262
the command-line integers::
6363

64-
$ prog.py 1 2 3 4
64+
$ python prog.py 1 2 3 4
6565
4
6666

67-
$ prog.py 1 2 3 4 --sum
67+
$ python prog.py 1 2 3 4 --sum
6868
10
6969

7070
If invalid arguments are passed in, it will issue an error::
7171

72-
$ prog.py a b c
72+
$ python prog.py a b c
7373
usage: prog.py [-h] [--sum] N [N ...]
7474
prog.py: error: argument N: invalid int value: 'a'
7575

0 commit comments

Comments
 (0)