Importing some functions from a py file

Anthony Liu antonyliu2002 at yahoo.com
Tue Apr 19 22:13:13 EDT 2005


Hi,

I think I got confused by the python import facility.

Say, in code1.py I have func1, func2, func3 and main.

In code2.py, I *only* want to use func2 from code1.py.

So, I did

from code1 import func2

But every time, I run code2.py, the main() of code1.py
is run.

I don't know why.  Any hint please?  Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Python-list mailing list