Got 2 files:
First is called: main.py
import side
var = 1
side.todo()
Second is called: side.py
import main
def todo():
print "printing variable from MAIN: %s" %(main.var)
I get an error, when i run main.py:
AttributeError: 'module' object has no attribute 'todo'
In python are you not allowed to borrow and use variables, in such manner?
I have tried to search for documentation related to this, but could not find anything related to this problem.
Surely, there is an alternate way of doing this?