469,357 Members | 1,729 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,357 developers. It's quick & easy.

how can i asssign a buttons label to an entry in python when the button is clicked?

am trying to give functionality to calculator buttons.that is, when i click the button like button with label 7, the letter 7 should appear in an entry.
Apr 17 '15 #1

✓ answered by dwblas

See the first example at http://effbot.org/tkinterbook/button.htm which shows how to connect a function to a button click. Instead of a print, you would (sometimes delete first and) insert into the Entry like the first example at http://effbot.org/tkinterbook/entry.htm

2 1382
bvdet
2,851 Expert Mod 2GB
Assign a command to your button. The command could concatenate the current contents of the entry widget with the label of the button.
Apr 17 '15 #2
dwblas
626 Expert 512MB
See the first example at http://effbot.org/tkinterbook/button.htm which shows how to connect a function to a button click. Instead of a print, you would (sometimes delete first and) insert into the Entry like the first example at http://effbot.org/tkinterbook/entry.htm
Apr 17 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by TJS | last post: by
6 posts views Thread by =?Utf-8?B?L2Rldi9udWxs?= | last post: by
5 posts views Thread by Jim in Arizona | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.