Re: command line argument passing

2005-07-22 Thread Dennis Benzinger
Hayri ERDENER schrieb: > hi to all, > is it possible in python to pass arguments by using command prompt in > windows 2000 and XP ? > for example: > sourceCode.py factorial 4 > gives me the factorial of 4 namely 24. > best regards import sys print sys.argv Or use the optparse module. Docs:

Re: command line argument passing

2005-07-22 Thread gene tani
just remember: sys.argv[0] == script name http://www.artima.com/weblogs/viewpost.jsp?thread=4829 -- http://mail.python.org/mailman/listinfo/python-list

Re: command line argument passing

2005-07-22 Thread Peter Hansen
Hayri ERDENER wrote: > hi to all, > is it possible in python to pass arguments by using command prompt in > windows 2000 and XP ? > for example: > sourceCode.py factorial 4 > gives me the factorial of 4 namely 24. Yes, the arguments are available as a list in sys.argv . Remember that you need

command line argument passing

2005-07-22 Thread Hayri ERDENER
hi to all, is it possible in python to pass arguments by using command prompt in windows 2000 and XP ? for example: sourceCode.py factorial 4 gives me the factorial of 4 namely 24. best regards -- http://mail.python.org/mailman/listinfo/python-list