D
dody suria wijaya
I found this problem when trying to split a module into two.
Here's an example:
==============
#Module a (a.py):
from b import *
class Main: pass
==============
==============
#Module b (b.py)
def How():
Main_instance = module_a.Main()
return Main_instance
==============
the problem would show at How() function. I have been unable
to get variable pointing to module a from inside module b.
In short, I need to have a variable pointing to the module
whose importing me.
Here's an example:
==============
#Module a (a.py):
from b import *
class Main: pass
==============
==============
#Module b (b.py)
def How():
Main_instance = module_a.Main()
return Main_instance
==============
import a
a.How()
the problem would show at How() function. I have been unable
to get variable pointing to module a from inside module b.
In short, I need to have a variable pointing to the module
whose importing me.