So, my problem is that I have a circular import but I also need both of the imports that cause it. In the main file, I have a class that is needed for the second file.
mainfile.py:
class Example:
def __init__(self, age):
self.age = age
import secondfile
print(secondfile.main())
secondfile.py:
import mainfile
ex = Example(22)
def main():
return f"You are {ex.age} years old."
Is there a way to solve this without defining the class again?