Re: [Tutor] Question on option parser

2006-05-16 Thread Karl Pflästerer
On 16 Mai 2006, [EMAIL PROTECTED] wrote: > Is there a way to leverage optionparser so it can accept input from both > command line and a configuration file? > > Current code block is: > > # > # Parse command line options and automatically build > # help/usage display > # > pars

Re: [Tutor] Question on option parser

2006-05-16 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Kent, If I understood correctly, you meant something like this? # # Parse command line options and automatically build help/usage # display # if len(sys.argv) == 2: infile= open(sys.argv[1],"rb").read()

[Tutor] Question on option parser

2006-05-16 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Everyone, I have a program that I'd would like to enhance flexibility in calling. Is there a way to leverage optionparser so it can accept input from both command line and a configuration file? Current code block is: # # Parse command li