python getopt functionality

M.N.A.Smadi smadim2 at grads.ece.mcmaster.ca
Mon Oct 3 15:19:09 EDT 2005


It is not clear to me if i can define `mandatory' options? That sounds 
strange but let say that the command `requires ' a value for -z or --zoo 
(either or should be find but one and only one of them MUST be 
present).  Can i do that with resorting to using if statements?

thanks
moe smadi
Fredrik Lundh wrote:

>"M.N.A.Smadi" wrote:
>
>  
>
>>I have a perl script that I need to port to python. The script takes
>>input from the command line.  Is there a standard way of processing
>>command line arguments based on the -flag preceeding the argument?
>>    
>>
>
>http://docs.python.org/lib/module-getopt.html
>http://docs.python.org/lib/module-optparse.html
>
></F>
>
>
>
>  
>




More information about the Python-list mailing list