I am trying to create an application that can open another .py file(Tkinter application). I had tried the below code and it works for first time(it opens another application for the first time) but if i close that app and try to open it again by clicking on the open button then it doesn't open for second time.
Main Application:
from tkinter import *
root=Tk()
def ope():
import SecondApp
Open_1=Button(root,text="Open",command=ope)
Open_1.pack()
root.mainloop()
SecondApp:
from tkinter import *
root1=Tk()
Label=Label(root1,text="Hey welcome in second app")
Label.pack()
root1.mainloop()
If i click the Open_1 button
for first time from mainapp then it open second app in that time but if i try again then in second time it doesn't do anything.
And in last I want to open the second window using import SecondApp
Please Help me as soon as possible. Thanks for everyone who tried to solve my problem