Hey all, I'm kind of new to python and hope you can help me figure this out.
I cant seem to get the letter to pass to the print. Thanks for any help.
Forgot to add that it will only pass the letter z. The buttons show the right letter. Just the command doesn't.
I cant seem to get the letter to pass to the print. Thanks for any help.
def main(): root = Tk() app = Database() alphabet = string.ascii_uppercase letters = [] for letter in alphabet: letters.append(Button(text=letter, command=lambda:print(letter)).pack(side="left", padx="1", ipadx="2", ipady="2")) ebutton = Button(root, text="Exit", command=quit, fg="red").pack(side="left", padx="1", ipadx="2",ipady="2") root.mainloop() if __name__ == '__main__': main()
Forgot to add that it will only pass the letter z. The buttons show the right letter. Just the command doesn't.
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts