This is a quick guide to set up a Raspberry Pi for IO control shenanigans.
Pick an SD card and write an image plus SSH config on your laptop.
https://www.raspberrypi.com/software/operating-systems/
Raspberry OS Lite, possibly 64-bit for Pi 3 or later
unxz the image, then dd; e.g.:
unxz
dd
sudo dd status=progress \ if=2024-11-19-raspios-bookworm-armhf-lite.img \ of=/dev/mmcblk0
cp -r ssh-dir rootfs/home/pi/.ssh
touch bootfs/ssh
This is done from the running system.
raspi-config
3 Interface Options
/boot/cmdline.txt
/boot/config.txt
Do your Python foo...
Example:
https://github.com/torfsen/python-systemd-tutorial/blob/master/python_demo_service.service
You probably need the type exec or simple:
exec
simple
https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html