dimanche 22 décembre 2019

Py file import stops importing

when I try to run these two scripts together after a few tries it stops working? Is this because of the import module?

test1.py

test = input("Go to new script?: ")
if test=="yes":
    print("going to new script")
    import test2

test2.py

test = input("Go to old script?: ")
if test=="yes":
    print("going to new script")
    import test1

Error is that it ends itself.

C:\Users\bj\Desktop>python test1.py
Go to new script?: yes
going to new script
Go to old script?: yes
going to new script
Go to new script?: yes
going to new script

C:\Users\bj\Desktop>

Aucun commentaire:

Enregistrer un commentaire