By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,615 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,615 IT Pros & Developers. It's quick & easy.

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

P: 1
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

Share this Question
Share on Google+
2 Replies


bvdet
Expert Mod 2.5K+
P: 2,851
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

Expert 100+
P: 618
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.