import tkinter
from tkinter import *
class learn():
def __init__(self, root):
self.root=root
self.root.title("Hancie e-Learning Studio")
self.root.geometry("500x400")
def newgui():
main=tkinter.Toplevel()
main.title("Hancie e-Learning Studio")
main.geometry("300x200")
label=Label(main, text="Welcome everyone!")
label.pack()
main.mainloop()
btn=Button(self.root,command=newgui, text="Open new Frame")
btn.pack()
if __name__=='__main__':
root=Tk()
learn(root)
root.mainloop()
Output