[Tutor] import statement

Lloyd Kvam pythontutor at venix.com
Sat Mar 6 18:23:55 EST 2004


I do not think you can get that working using the from <module> import * syntax.
It is a bad idea in any case.  It is not worth the grief you go through to make
it work and keep it working.  Use a common file that has the pieces that filea and
fileb depend on - or simply combine filea and fileb into one module.

Jacob Abraham wrote:

> Dear Tutors,
>    Is it possible use the import statement between two
> files.
> 
> eg 
> #filea.py
> from fileb import *
> 
> #fileb.py
> from filea import *
> 
> #NameError: global name 'MyClass' is not defined
> 
> Thanks,
> Jacob Abraham
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster
> http://search.yahoo.com
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-653-8139
fax:	801-459-9582




More information about the Tutor mailing list