Apr-06-2020, 04:32 PM
Hi,
I suspect this is a very simple issue... I am trying to use a variable, loaded in one operation, within another operation. It is telling me the variable doesn't exist.
Below is the simplest way to reproduce my issue.
Thanks,
I suspect this is a very simple issue... I am trying to use a variable, loaded in one operation, within another operation. It is telling me the variable doesn't exist.
Below is the simplest way to reproduce my issue.
from tkinter import * root = Tk() root.title('Temp') root.geometry('300x300') def Import(): u = 1 v = 2 directoryButton = Button(root, text='Import', command=Import, padx=15) directoryButton.grid(row=0,column=0 ) def Calc(): t = u*v print(t) directoryButton = Button(root, text='Calc', command=Calc, padx=15) directoryButton.grid(row=0,column=1 ) root.mainloop()Help would be massively appreciated.
Thanks,