circular import snafu
Darrell Gallion
darrell at dorb.com
Thu Aug 10 21:04:06 EDT 2000
More information about the Python-list mailing list
Thu Aug 10 21:04:06 EDT 2000
- Previous message (by thread): circular import snafu
- Next message (by thread): circular import snafu
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Here's some fun with imports.
When things get really sticky I add a startup function.
--Darrell
open("f1.py",'w').write("""
import f2
x=5
f2.startUp()
f2.run()
""")
open("f2.py",'w').write("""
import sys
def startUp():
import f1
sys.modules[__name__].__dict__['x']=f1.x
def run():
print 'Run:', x
""")
import f1
# Also try running just f1.py
- Previous message (by thread): circular import snafu
- Next message (by thread): circular import snafu
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list