Python : parsing the command line options using optparse

Ganesh Pal ganesh1pal at gmail.com
Sat Mar 1 07:12:03 EST 2014


>
> handler = object_type_dictionary[options.object_type] # look up the
> function
> handler() # call it
>
> The last two lines could also be merged into one
>
> object_type_dictionary[options.object_type]()
>
> but the first version may be clearer.
>
>

Thanks  for your valuable inputs all worked :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140301/29a56b29/attachment.html>


More information about the Python-list mailing list