Here's a simple clicker program in Python using the tkinter
module for the GUI:
main.py567 chars25 lines
The program creates a Clicker
class with a counter variable count
. In the constructor, it initializes the GUI using tkinter
. The window and label are created with tk.Label
and tk.Button
, respectively. The button has a command which is set to the increment_count
method of the Clicker
class.
When the button is clicked, increment_count
is called which increments the count
variable and sets the text of the label to reflect the new count.
The program can be executed by creating a Clicker
instance and calling its run
method.
gistlibby LogSnag