Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3869

Python • Re: AttributeError: 'App' object has no attribute 'button' tkinter and gpiozero

$
0
0
I don't know tkinter but your line 'self.button.when_pressed = self.make_page_1' is trying to combine tkinter with GPIOZERO code. That is why you are getting the error. Python is looking for a 'button' reference in tkinter.

You need to manage 'button.when_pressed' outside of 'tkinker'. See https://gpiozero.readthedocs.io/en/stable/recipes.html for examples.

Statistics: Posted by DS256 — Sun Aug 25, 2024 11:51 pm



Viewing all articles
Browse latest Browse all 3869

Trending Articles