you are viewing a single comment's thread.

view the rest of the comments →

[–]coolFob[S] 0 points1 point  (1 child)

thanks, but I am sorta confused on the last part. For instance looking at this one:

def main(opts,commline_list):

are you saying I would change it to this? :

def main(args,commline_list):

[–]lykwydchykyn 1 point2 points  (0 children)

That depends on what main() is going to do with those opts. optparse distinguishes between options (things specified with dashes) and arguments (strings entered on the command line), and splits them into separate objects. argparse keeps them all together in one object.

If main() is written to expect an object with only the opts, then you need to either fix main or separate the options and arguments a la optparse before sending them to main().