The following is simplified code for better understanding. There are two modules,
The first:
from modulo2 import f1
f = [f1 + 4, f1 + 2]
def first():
print(f[0])
def second():
print(f[1])
The second:
from modulo1 import first, second
f1 = 0
def main_function(f1):
first()
second()
main_function(5)
main_function(10)
#
#etc
It is a case of circular import, and what I want is that when executing main_function(f1)
the variable f1
is modified in the first module according to the given argument.
I have tried many ways without success, I always get an error on import.
ImportError: cannot import name 'first'