I am currently trying to grasp the exact name of argv function (if it can be called a function) that can be imported from sys or system-specific parameters. I found 3 definitions:
So which one is it? Perhaps it doesn't matter how one calls it? Does it even have an accepted name?
Thanks everyone!
It doesn't really matter. It's a list (not a function), and the name argv
is just borrowed from the conventional name used in C. Most of the time, you are better off using a library like argparse
to process the command line arguments, in which case you won't even be using sys.argv
directly.
argv
is a variable (a list of arguments), and is therefore not a function.
The naming seems to come from conventions used in C, which uses argc
(argument count) and argv
(argument vector). See also https://stackoverflow.com/a/3024202/693140
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With