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:
just remember: sys.argv[0] == script name
http://www.artima.com/weblogs/viewpost.jsp?thread=4829
--
http://mail.python.org/mailman/listinfo/python-list
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
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