Python Forum
Button not defined, why?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Button not defined, why?
#6
Quote:buttons.append(Button(etc))
in his example buttons is a list of tkinter.Button objects.

Quote:list = ['btn1', 'btn2', etc]
If your listing out wishing the variables names to be btn1 and btn2...whats the point? you might as well stick them in a list and identify them by index anyways. buttons[0] will be the first and so on.

If you actually want to make custom names, just use a dictionary
buttons['exit'] and so on.
Recommended Tutorials:
Reply


Messages In This Thread
Button not defined, why? - by gb_johnny - Sep-12-2017, 07:31 AM
RE: Button not defined, why? - by Lux - Sep-12-2017, 11:29 PM
RE: Button not defined, why? - by Barrowman - Oct-23-2017, 09:40 PM
RE: Button not defined, why? - by Windspar - Nov-12-2017, 01:01 PM
RE: Button not defined, why? - by Barrowman - Nov-12-2017, 11:26 PM
RE: Button not defined, why? - by metulburr - Nov-13-2017, 12:06 AM
RE: Button not defined, why? - by Windspar - Nov-13-2017, 12:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Kivy] Acces atributes from a button defined in a class inside the .kv Tomli 2 2,148 Jun-10-2021, 01:05 AM
Last Post: Tomli
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,077 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  [Tkinter] button not defined OldManProgrammer 2 4,543 Nov-21-2018, 07:53 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020