Hello,

I am trying to use OptionParser (my first time) to set a variable (cvs_output). i.e. if --csv is given in the list of options, then cvs_output = True.
Then I check,
if cvs_output == True:
[...]


I have the following so far but something is missing.
from optparse import OptionParser
usage = "usage: %prog [options]"
parser = OptionParser(usage=usage)
parser.add_option("-cvs", dest="output", default=True, help="outputs the csv file 
for plotting activites")


python dUCx_ActivityPlots.py

python dUCx_ActivityPlots.2.py -h
Usage: dUCx_ActivityPlots.2.py [options]

Options:
  -h, --help         show this help message and exit
  --cvs=OUTPUT_FLAG  outputs the csv file for plotting activities


I don't really understand what dest and action in the arguments to 
parser.add_option mean.
Any help is appreciated.
Mina
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to