This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Learn Python the Hard Way

My recent threads

You haven't posted any discussions yet.

Recently updated threads

exercise 13 argv?

Go back to: General discussion

Anyone please tell me what argv is about?

Alexis Tsonis's picture
Alexis Tsonis
Thu, 2011-02-03 02:05

argv is an array (at least in C language,but I guess it will be the same here).
By the argv array you can manage the arguments you give in the command line.
You may have a program that needs more than one argument in order to run.So you type for example:
exercise.py 12 23 54
exercise.py is argv[0]
12 is argv[1]
23 is argv[2] and
54 is argv[3]
I hope I helped!