Given code like this, how do I actually set a file in the run options?
I am using Spyder and have put -h -s -p -o
as arguments, but I'm not sure how to specify a named file for the -o
option.
class CommandLine: def __init__(self): opts, args = getopt.getopt(sys.argv[1:],'hspw:o:') opts = dict(opts) if '-o' in opts: self.outfile = opts['-o'] else: self.outfile = None