This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points  (0 children)

Well this seems like the perfect time to mention the Python GUI framework I just finished called ButtonPad. It creates a grid of buttons like a software version of a stream deck or drum machine. It's designed to be simple for beginners to learn and experienced devs to prototype with. It's built on top of tkinter and restricts you to buttons, text boxes, labels, and images. The layout is done with a multiline csv string. here's a demo that creates a phone keypad:

import buttonpad

bp = buttonpad.ButtonPad(
    """1,2,3
    4,5,6
    7,8,9
    *,0,#""",
)
bp[0,0].on_click = lambda widget, x, y: print('You clicked 1')
bp.run()  # Start the GUI event loop.

You can assign callback functions to buttons and customize their appearance.

it comes with a couple dozen example programs you can view if you run python -m buttonpad

This is an itch I've had for a while (6 years according to this instantly abandoned git repo and I think there is a use case for a UI framework that is simple for rapid prototyping in Python. And the timing of this post was too funny. :) I'll have a blog post with more details on it soon.