[Tutor] grid manager question

David bouncingcats at gmail.com
Mon Feb 13 17:54:43 EST 2023


On Mon, 13 Feb 2023 at 20:43, Phil <phillor9 at gmail.com> wrote:

> class App(tk.Tk):
>      def __init__(self, num_leds=8):
>          tk.Tk.__init__(self)

[...]

>      app = App()
>      app.mainloop()

Another suggestion that might help to declutter your
code and your mind: don't use this pointless App() class.

You don't need it. And it's not required, it's something
you created in your code.

Removing it will provide the benefit of clarifying your
code by removing the clutter of useless 'self.' references
to a class that is only ever instantiated once.

See the demo example I showed in the other thread,
which has no App() class.


More information about the Tutor mailing list