[Tutor] Testing Membership in a Sequence

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Mar 16 13:09:19 EST 2004


> What I am actually trying to do is look for command line 
> options in sys.argv.
>
> if '-o' in sys.argv or '--option' in sys.argv:
>    apply_option()

Have you looked at the getopt module?
It might be easier...

Alan G.



More information about the Tutor mailing list