A few beginning questions
bdesth.nospam at removeme.free.fr
Mon Jul 14 22:39:22 CEST 2003
> Ive just started playing with Python and have a couple of questions.
> Im looking for an agument parsing library (from the command line), Ive come
> across optik and argtools. What other ones are there are any of them any
> good, is there a 'standard' lib for doing this.
See other posts in this thread
> Also how should I '#define' magic numbers in Python. I spent ages looking
> around for a 'define' statement or anything that will allow me to create a
> constant value 'object'. Am I missing something very obvious ?
The 'obvious' thing you might be missing is that Python relies heavily
on programmers following conventions, where other languages impose
strict rules... Some conventions are :
UPPERCASE_VARIABLE : a constant, don't touch unless you really know what
_NameWithLeadingSingleUnderscore : 'protected' access , don't touch
unless you really know what you're doing
a 'magic' thing, don't touch unless you really know what you're doing
A special case is __NameWithLeadingDoubleUnderscore :
In older Python version, it was just a convention for 'private' access,
now it makes Python doing some mumbo-jumbo name mangling (which don't
strictly enforce 'privacy', but)...
Another special case is the 'self' pseudo-key word : the first argument
for object methods could be named whatYouWant, but (almost ?) everybody
> Also, what 'IDE/editor' do people recomend for MAC OSX, so far Ive found
> 'Hydra' to be the best as it works on plain files and has Python syntax
> highlighting... what else is there and are any of them any good.
I guess vim and emacs should run on Mac OS X ?
> Has nobody written an editor/IDE in Python with wxWindows so that it runs on
> all platforms ?
You could try boa contructor (a wxPython delphi-like RAD/IDE).
More information about the Python-list