Importing from files issue

So I have an issue with importing on one script, but the other its working fine. I have to files one that has all the main code and then the other that handles everything that gets printed in a console.

I’ve had a definition script that handles color changes in the, and it imported just fine over to my (where the prints are handled). But when I try to import my definition code called “printout” it has an issue importing it from to

Repl link:

not working in

from prints import outprint

working in

from main import colorChange

you forgot to close at the end of, like


Hm, I fixed up some code errors but I seem to still getting the line seven error on for some odd reason…

Read the error, you are importing printout from main and main from printout, this is circular and illegal in python. Make a third file and put the changeColor function in it and then import that file from main and printout


That seems to have fixed things, I appreciate the help! I try to get that in mind from now on.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.