I have a simlair problem as in this question: AttributeError: 'module' object has no attribute
I'm doing a mutual top level import which is causing me to have AttributeError: 'module' object has no attribute error so but I'm not sure if I can import within a function because I'm basically importing a file that controls all the other modules.
Here's an example(file2.py):
import file1
count = 0
while count < file1.number_of_loops:
.....
My functions are being triggered by the control variables so I'm unable to import within the function itself. Short of creating a sperate file to control, is there a way to refer to variables in another file without doing a mutual top level import?