I am dealing with some python code automatically generated for me. I want to avoid manually editing these python files & hence this question/issue:
foo.py:
def foo():
print "foo"
boo.py:
def boo():
foo.foo() # <-- global name 'foo' not defined
print "boo"
bar.py:
import foo
import boo
def bar():
boo.boo()
print "bar"
Execution of:
python.exe bar.py
gives an error that boo did not find foo. But bar is importing both foo & boo. Shouldn't foo be automatically available to boo?
Is there a way to do so? As said boo.py is automatically generated for me & I want to avoid adding import foo to boo.py
Thanks.