Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
n? My code needs to be 2.3-compatible. On Mon, Apr 13, 2009 at 5:32 PM, Static Vagabond wrote: I think getopt will help you achieve what you need. http://docs.python.org/library/getopt.html A. Please don't top-post. It makes following the conversation more difficult by presenting it out o

Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
I think getopt will help you achieve what you need. http://docs.python.org/library/getopt.html Here's a quick example: import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "-i:vo:vhb?") except getopt.GetoptError, err: helpCommand() # defined elsewhere. sys.exit()