command line argument passing

Dennis Benzinger Dennis.Benzinger at
Fri Jul 22 15:19:19 CEST 2005

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:
>  factorial  4
>  gives me the factorial of 4 namely 24. 
> best regards

import sys

print sys.argv

Or use the optparse module. Docs:


More information about the Python-list mailing list