When I compile this code:
def compileF():
file = text.get('1.0', END)
print(file)
text = Text(root, height=40, width=60, fg="black", font="Helvetica 12")
I get an ERROR:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "C:\Users\MIK\Desktop\GranitePad\GranitePad.pyw", line 16, in compileF
file = text.get('1.0', END)
UnboundLocalError: local variable 'text' referenced before assignment
What is going on?