On Mon, Oct 05, 2009 at 01:44:11PM +1100, Ben Finney wrote:
> Matthew Palmer <mpal...@debian.org> writes:
> 
> > So someone's using a single file as both a library and a stand-alone
> > program. Damned silly idea.
> 
> Not so silly; a Python module can be useful both as a main program and
> as a re-useable component in other programs. The well-known Python idiom
> of testing ???if __name__ == '__main__'??? is commonly used to make a module
> that can be used in either way.

It can be done in other languages too; doesn't make it a good idea.

- Matt


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to