Question: Circular import issue error in Tkinter python. I have two files , Driver.py and Log.py. In the driver file, I imported a class from Log

Circular import issue error in Tkinter python. I have two files , Driver.py and Log.py.

In the driver file, I imported a class from Log (from log import sign_in) so that the button in the driver can access the window in Log. In the same way, I imported Driver in my log.py (import Driver) so that a function I created in log.py can access objects in Driver like( driver.object()). Python responds with the expected error ("circular import error"). I attempted to solve the problem by searching the internet for solutions. I could not find a solution. I tried to create a THIRD_FILE.py that imports from both files, but it did not work. Probably, I need to improve my thirdfile and want to know how. Please, give a customized example using Tkinter and explain how third_file should be a solution or alternative solution. Thanks for your time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!