[Python-checkins] cpython (2.7): Use the platform-independent way of calling a script from the shell: "python
georg.brandl
python-checkins at python.org
Sun Oct 6 19:33:43 CEST 2013
http://hg.python.org/cpython/rev/9524e1468913
changeset: 86132:9524e1468913
branch: 2.7
parent: 86123:bc12d18c6aa3
user: Georg Brandl <georg at python.org>
date: Sun Oct 06 19:33:56 2013 +0200
summary:
Use the platform-independent way of calling a script from the shell: "python prog.py", not "prog.py"
Found by Micheal Wells on docs at .
files:
Doc/library/argparse.rst | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -46,7 +46,7 @@
Assuming the Python code above is saved into a file called ``prog.py``, it can
be run at the command line and provides useful help messages::
- $ prog.py -h
+ $ python prog.py -h
usage: prog.py [-h] [--sum] N [N ...]
Process some integers.
@@ -61,15 +61,15 @@
When run with the appropriate arguments, it prints either the sum or the max of
the command-line integers::
- $ prog.py 1 2 3 4
+ $ python prog.py 1 2 3 4
4
- $ prog.py 1 2 3 4 --sum
+ $ python prog.py 1 2 3 4 --sum
10
If invalid arguments are passed in, it will issue an error::
- $ prog.py a b c
+ $ python prog.py a b c
usage: prog.py [-h] [--sum] N [N ...]
prog.py: error: argument N: invalid int value: 'a'
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list