Hello! I am new to tkinter and i am trying to make a calculator on my own. I made buttons for every number and action but i want to know how to make the numbers appear in horizontal order and in a certain space when clicking said buttton. I am also not sure how to make the program understand when i clicked a button so that it can perform the action(f.e. multiplication)Can u please help me figure it out?
You could try this:
def show_number(x):
.....code ...
button01 = Button(root,text='1',font='ARIAL',command=lambda: show_number(1))
button02 = etc...
Paul
Out of interest, how are you learning how to use it? Doing something when a button is clicked seems like a fairly important thing so any tutorial or the docs should cover such things.
(Aug-30-2020, 02:57 PM)DPaul Wrote: [ -> ]You could try this:
def show_number(x):
.....code ...
button01 = Button(root,text='1',font='ARIAL',command=lambda: show_number(1))
button02 = etc...
Paul
Thank u i tried it + found a tutorial i hadnt seen before so i figured it out!
(Aug-30-2020, 03:05 PM)ndc85430 Wrote: [ -> ]Out of interest, how are you learning how to use it? Doing something when a button is clicked seems like a fairly important thing so any tutorial or the docs should cover such things.
Actually not many tutorials show that i had to search a lot to find one. But thanks a lot for ur response