I´d like to create a function, which will take it´s parameter from Button click.
For instance:
from Tkinter import *
def func(b):
number = 2*b
print number
return
root=Tk()
# By clicking this button I want to set b = 1 and call func
b1 = Button(root,...)
b1.pack()
# By clicking this button I want to set b = 2 and call func
b2 = Button(root,...)
b2.pack()
root.mainloop()
So after clicking b1, “number” should be 2 and after clicking b2, “number” should be 4.
I hope I explained my problem well.
Thanks for answers
mountDoom
Here’s one way