apps and ui

2023-11-29

ui script

I wrote this one using Python's tkinter bindings. It's a UI for my previous weeks' Mifare Classic 1K card cloner. Not doing anything special -- just I/O over the text serial port with regex / string matching to determine what the board is doing, and direct serial port writes in response to button clicks.

The button functionality mirrors what I describe in the output devices section re: modes.

(NB: for logistical filming reasons, these two videos aren't simultaneous. Also note the "write" button not causing a mode change with an empty key is an intentional part of the embedded functionality.)

Another note: it was easier for me at the time to set this up on my breadboard version — it works on the milled board just as well.

tkinter

I picked tkinter because it's fast and extremely easy to hack something in -- far nicer than web (which requires a whole browser), and built-in to most headed Python distributions.

It's very old-fashioned -- everything is mutable state, there's no asynchrony, you drive the event loop manually, and there's no markup language to make design easier, but I really haven't found anything better for rapidly building small, dependency-free1 cross-platform UI with a code size footprint of kilobytes2.

1

Up to requiring a tkinter-enabled Python install — obviously it has this runtime dep, but no third-party packages that a user would have to install.

2

Again, discounting the size of the supporting Python distribution, but even so, this is much much more minimal and resource-efficient than a browser.