Sean writes “Here’s a follow-up to your recent perlParallel post. It’s a python module for controlling the parallel port. This module encapsulates the access for the parallel port. It provides backends for Python running on Windows and Linux. They also have a serial port controller here. Link.
Discuss this article with the rest of the community on our Discord server!
We'll assume you're ok with this, but you can opt-out if you wish.
0 thoughts on “Control the Parallel (or Serial) Port with Python”
This is wonderful! Now how ’bout PHP? (not as groovy as python, but…)
Wondering why my post on using Pyserial to interface with external buttons didn’t get posted? Is it just a long approval process, or was it rejected?
Here’s a python script that uses PySerial to interact with buttons connected to your serial port. So you can use those buttons to do whatever you’d like on your computer. The circuit is super simple, just shorts 4 of the pins to ground:
I personally find it easier to splice an old serial cable than the way he did it. Cheaper too. And I hate to admit it, but there’s been a couple of times that I didn’t have a continuity meter handy and I simply spliced wires and connected them randomly until I got a reaction, and I havn’t fried any serial ports yet.
And it works great with those USB to serial adaptors too.
Note that there’s a really good Winamp plugin on that page that also interfaces with this circuit, and in that program are instructions to connect up to 15 buttons to a single serial port, and this script can probably be easily adapted to that. Also note that the above circuit works with the excellent Windows automation program Girder.
Feel free to email wrybread@gmail dot-you-know-what with any questions.
Anyway, here’s the script, which for some reason is showing up double-spaced:
And to the person wishing for PHP support, I’d highly recommend sucking it up and learning Python…
The article is really wonderful.Well how to control a board with ATmega16 microcontroller connected to the serial port with buttons on the screen.The buttons on the screen should function as toggle switches and pressing them should control any device such as a dc motor connected to the controller.