organizing your scripts, with plenty of re-use

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Oct 13 01:14:57 CEST 2009


En Mon, 12 Oct 2009 19:07:38 -0300, Buck <workitharder at gmail.com> escribió:
> On Oct 10, 1:57 am, Steven D'Aprano <st... at REMOVE-THIS-
> cybersource.com.au> wrote:
>> #!/usr/bin/python
>> import os, sys
>>
>> if __name__ == '__main__':
>>     # find out where we are, and add it to the path
>>     [...]
>>
>> That's not a lot of boilerplate for a script.
>
> My issues with boilerplate are several. [...]

As pointed out before, all this boilerplate code is actually unnecesary.
Just import the module you want from its package, and you're done  
(usually).

-- 
Gabriel Genellina




More information about the Python-list mailing list