/3/library/argparse.html#module-argparse
An observation: In example 16.4.1, a script named 'prog.py' is given, and the user is told that they may execute it from the command line like so: $ prog.py My issue with this, is that it doesn't mention that the script starts with a shebang or is made executable with chmod +x, and even then the command would be $ ./prog.py. A minor gripe, but I think that too much is assumed of the reader. For reference: 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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 22.03.2013 17:03, schrieb Micheal Wells:
An observation:
In example 16.4.1, a script named 'prog.py' is given, and the user is told that they may execute it from the command line like so: $ prog.py
My issue with this, is that it doesn't mention that the script starts with a shebang or is made executable with chmod +x, and even then the command would be $ ./prog.py.
A minor gripe, but I think that too much is assumed of the reader. For reference:
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
Hi Micheal, thanks for the report; I've replaced the invocations by "$ python prog.py" which should work on every platform. The change will go live soon. cheers, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (GNU/Linux) iEYEARECAAYFAlJRnz4ACgkQN9GcIYhpnLCS/QCdGOjCnbh4fsOHaB7xYVERhoQ+ 7ZoAoKGUnuscumnuAXsSTa1F103kAo0E =E1wH -----END PGP SIGNATURE-----
participants (2)
-
Georg Brandl
-
Micheal Wells