Hello I start off this email with wishing everybody a good health. The documentation python tutorial release 3.6.10 has got an error. paragraph 2.1.1 Argument parsing it reads : when no script and no arguments are given, sys.argv[0] is an empty string. When the script name is given as '-' (meaning standard input), sys.argv[0] is set to '-'. When -c command is used, sys.argv[0] is set to '-c'. When -m module is used, sys.argv[0] is set to the full name of the located module. Options found after -c command or -m module are not consumed by the Python interpreter’s option processing but left in sys.argv for the command or module to handle. That should be sys.argv[1]. sys.argv[0] gives the full path of the interpreted used. An example: In [2]: print(sys.argv) ['/usr/bin/ipython3', '-c', 'print("data")', '-i'] I used python 3.8.5 ------------------------------------------------------ Sent with [ProtonMail](https://protonmail.com) Secure Email.
participants (2)
-
guyrenebongers71
-
Julien Palard