I have came up with a simple code where I cannot figure out why and how it can be solved with circular imports.
test.py
from test2 import specific_ID
store_name = "testing"
STORE_ID = specific_ID()
print(STORE_ID)
test2.py
from test import store_name
print(store_name)
def specific_ID():
print("Yay works")
print(f"Store name: {store_name}")
return True
the idea is that when I have the variable store_name in test.py, I would like it to be a sort of "constant" value where I can re-use the value in test2.py - However it does not seems to like where it throws err:
from test2 import specific_ID
ImportError: cannot import name 'specific_ID' from partially initialized module 'test2' (most likely due to a circular import)
My question is, how is it possible to re-use a variable from test.py to test.py?