Module trouble [newbie]

Boris Ozegovic silovana.vjeverica at com.gmail
Fri Feb 23 06:44:17 EST 2007


Can somebody explaint this to me:

I have module a.py
A = 100
import b
print "A printing"
print "B is %s" % b.B

and module b.py
B = 2000
import a
print "B printing"
print "A is %s" % a.A

I thought that output would be:
B printing
A is 100
A printing
B is 2000

Because import b would execute b.py, and in b.py line "import a" would be
ignored, but my output is:

>>> import a
100
A printing
B is 100

??

:)

-- 
http://www.nacional.hr/articles/view/23894/23



More information about the Python-list mailing list