general coding issues - coding style...

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Feb 19 17:06:58 EST 2006


calmar a écrit :
> Hi all,
> 
> since I'm just a 'handicraft'/beginner or so,
> 
> could anybody provide me with some (rough) hints, about how to enhance the code
> here:
> 
> http://calmar.ws/tmp/cal.html

1/ learn OO and get rid of globals.
2/ use dict or list based dispatch instead of long if/elif/elif... clauses
3/ stdout is meant for *normal* program outputs. Errors and verbosity go 
to stderr
4/ triple quoted strings are fine for multiline text
5/ os.path is fine for portable filepath operations
6/ things that dont change during program execution (ie : constants) 
should not be defined inside a function



> Cheers and thanks a lot
> calmar
> 
> 



More information about the Python-list mailing list