Another newbie getopt thread. ^_^

Chris Cioffi evenprimes at gmail.com
Sun Jul 18 00:17:06 CEST 2004


On 17 Jul 2004 15:06:25 -0700, googleboy <mynews44 at yahoo.com> wrote:
> Hiya!
> 
> I discovered getopt tonight after getting halfway through writing huge
> amounts of looping statements to try to ensure that text entered as
> parameters to my python app are within the bounds of what is allowed.
[snip]

Look at the optparse module. 
http://www.python.org/doc/2.3.4/lib/module-optparse.html

It allows you to define the parameter type, making it far easier to do
any followup validation.  As a bonues, it provides automatic support
for stuff like 'program --help'.

Chris
-- 
Still searching for an even prime > 2!



More information about the Python-list mailing list