I am quite new to python but I have been given some code by a group project teammate that I need to integrate with my own code. The main programme is contained in a main.py file which imports variables from a settings.py file. main.py also imports functions from functions.py file. functions.py also imports variables from settings.py. My own code requires iteration so I need to be able to change the settings.py variables when running main.py to solve the problem. Ideally I can find a way to adjust my teammates code to become a function that I can simply pass variables into and out of.
I have tried to import variables from main.py to settings.py but that results in cyclic importing. I can't find any solutions and not for lack of trying and would really appreciate any help.
main.py
import settings
import function
settings.x=10
print(settings.x+function.y)
settings.py
x=1
function.py
import settings
y= settings.x
Effectively I want this to print out 20 and not 11.