I'm trying to split my python code into a few files :
file1.py
from file2 import *
var1 = 7
func_file2()
file2.py
def func_file2():
var2 = var1
So it says:
NameError: global name 'var1' is not defined
How can I fix that?
I tried to import file1 in file2.