Context: I am a retired engineer making things to interest kids in electronics and programing. Nothing is for profit. After all Kids need to be prepared for a career and these skills are needed for small things like scanners and printers to EVs and factory machines that make things.
Since Eclipse left Fedora, I’ve been using Thonny to write Python code. I’m using Python to operate mechanisms of various kinds. via a Tkinter GUI The electronics that runs the motors and reads sensors in the mechanisms is interfaced via USB to a PC running Fedora Workstation. The USB chip in my electronics pretends to be an HID Serial device So I use the Python Serial library to “talk to” the electronics that runs the mechanisms. Though technically this is a real time application nothing I’ve done so far would be considered fast. For the projects I’ve done so far I’ve had >100 percent safety margins where responsiveness is concerned with my code running from Thonny or the command line. My modest requirements on responsiveness are due to simple motor controls which are run, direction, and speed. The first two are single bits and last is a three bit number all of which are sent in a single byte. So far there have only been three sensors all of them are single bit which are read in a single byte The actual changes for sensors is about 5 seconds between detections and a detection lasts lasts for about 2 seconds. The mechanisms work fine and reliably.
Lately I have been considering taking up some projects that would need to run faster (stepper motors). State changes for motor control would be between 10 and 20 times per second. I do intend to set up a bare USB interface of the kind I described earlier to test this, but I am mentally prepared for it to not work, but still hoping it may work to something like 10 per second.
Is the Python interpreter that is the standard interpreter installed with Workstation a line by line interpreter or does it do any AOT or JIT?
I have a fall back for the faster needs. I can make the electronics more complicated, but I’d prefer not to do that. Simple is more reliable and easier to understand.
Any guidance or suggestions in regard to my probable desire for more speed in python will be appreciated.
Thank you in advance.