I have two files:
global var def test(): var = "Hello!" return
from lib import * test() print(var)
But despite having them in the same folder, when I run test.py, I get the following error:
Traceback (most recent call last): File "C:\Test\test.py", line 5, in <module> print(var) NameError: name 'var' is not defined
How can I access this variable in a function in another file?