Hi,
Could some one take a look at the below code snipet which keep
failing:
import optparse
p = optparse.Option Parser(descript ion="script to do stuff",
prog="myscript. py", ....)
p.add_option("-c" "--compress", help="0 is noncompress")
function1(optio ns.compress)
here's what the what function definition looks like:
function1(zipfi le) :
if (zipfile == 1):
do stuff here with for compress file
else
do stuff here
when I call the script "myscript.p y 1", the above test keeps falling
to the else clause. I am thinking the object zipfile is not the same
as "1". Any thoughts as how I should test if the argument being pass
in and parse by optparse is 1 or "0"? Thanks.
Could some one take a look at the below code snipet which keep
failing:
import optparse
p = optparse.Option Parser(descript ion="script to do stuff",
prog="myscript. py", ....)
p.add_option("-c" "--compress", help="0 is noncompress")
function1(optio ns.compress)
here's what the what function definition looks like:
function1(zipfi le) :
if (zipfile == 1):
do stuff here with for compress file
else
do stuff here
when I call the script "myscript.p y 1", the above test keeps falling
to the else clause. I am thinking the object zipfile is not the same
as "1". Any thoughts as how I should test if the argument being pass
in and parse by optparse is 1 or "0"? Thanks.
Comment