Importing some functions from a py file

Michael Soulier msoulier at gmail.com
Tue Apr 19 22:57:23 EDT 2005


On 4/19/05, Anthony Liu <antonyliu2002 at yahoo.com> wrote:
> 
> You are certainly right, because I don't know how to
> protect the main functions.  Where do I put
> 
> if __name__ == '__main__': main()

I just glanced in the modules section of the python documentation and
surprisingly this is not mentioned at all that I could see. I think
that's an oversight.

See this example:

http://diveintopython.org/getting_to_know_python/index.html

Mike

-- 
Michael P. Soulier <msoulier at gmail.com>
http://www.digitaltorque.ca
http://opag.ca      python -c 'import this'
Jabber: msoulier at digitaltorque.ca



More information about the Python-list mailing list