PDA

View Full Version : [python] Argument Phasing



Pyro.699
August 28th, 2008, 01:42 AM
Hello,

Is there a simple way to phase arguments given to a python script? like

python main.py -u username -p password -r random text with spaces -n next argument

all the text values after -* are assigned to specific variables or something basically that command line would create a 4 variable array

thanks
~Cody Woolaver

ghostdog74
August 28th, 2008, 01:48 AM
see here (http://docs.python.org/lib/module-optparse.html). Read the docs!