NameError: name 'tk' is not defined repl.it
repl.it has nothing to do with the issue. You have lines referencing "tk
", like app = tk.Tk()
, but you never defined anything called tk
. It looks like some of your code expects you to have imported Tkinter via import tkinter as tk
, in which case tk
would be valid. But you also have code expecting it to be called tkinter
, like root = tkinter.Tk()
. It seems like your code was inspired from multiple sources, some of which had Tkinter imported as tk
, and some where it was imported as tkinter
. All you have to do is replace all tk
s with tkinter
. For example, this line:
Def_Btn = tk.Button(app,text='Default Button')
would become:
Def_Btn = tkinter.Button(app,text='Default Button')