Hi there. I just wondered whether anyone could recommend the correct
way I should be passing command line parameters into my program. I am
currently using the following code:
def main(argv = None):
file1= directory1
file2 = directory2
if argv is None:
args = sys.argv[1:]
[EMAIL PROTECTED] wrote:
Hi there. I just wondered whether anyone could recommend the correct
way I should be passing command line parameters into my program. I am
currently using the following code:
snip/
Use the module optparse.
Diez
--
[EMAIL PROTECTED] writes:
I have never used Python to pass in arguments at the command line so
any help would be much appreciated.
Your 'main()' approach is good. I'd rather have the function require
an 'argv' parameter, and have the default set only in the 'if __name__
== __main__:' block,
On Mon, 24 Sep 2007 01:04:58 -0700, cjt22 wrote:
for i in range(len(args)):
if args[i] == -no:
Initialise.init(0)
Process.processCon(file2,1)
Output.print()
if args[i] == -not:
Initialise.init(1)
[EMAIL PROTECTED] wrote:
Hi there. I just wondered whether anyone could recommend the correct
way I should be passing command line parameters into my program. I am
currently using the following code:
def main(argv = None):
file1= directory1
file2 = directory2
if argv