I want the main.py to have access to file.py and vise versa
>main.py
>folder
|-->file.py
for example, I have 2 classes located in two files:
in main.py
class MyClass():
#somecode
in file.py
class Tools1():
#somecode
I have tried to use import at the start of each file but then I got an ImportError
main.py
from folder.file import Tools1
file.py
from main import MyClass
then I got this error when I run the main.py
ImportError: cannot import name 'Tools1' from partially initialized module 'folder.file' (most likely due to a circular import)
Is what I am doing posible in python? If so what I am doing wrong?