[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"
>
>
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] 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,
[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:
Use the module optparse.
Diez
--
http://mail.python.org/mailman/listinfo/python-list