Parallel port control in Python
Controlling the parallel port has always been a pain in Windows 2000, XP and later. In DOS or older versions of Windows you could just write a byte directly to port 0×378 and that was it.
Now you can get the same level of simplicity using inpout32.dll and Python. Go here to download the DLL and you can access it from Python just as easily as it used to be under DOS. The following example writes the number 5 to the parallel port:
import ctypes ctypes.windll.inpout32.Out32(0x378, 5)
UPDATE: I have made a simple demo app using this technique. You can download it from my commercial website at http://siliconsparrow.com/parallel-port-tester-in-python/.

Will this hold the port to 5 or will it revert instantly to 0?
It will hold it until you write a different value to the port.
Thanks for the info
Hey – thanks Adam.
Much appreciated – I’ve been pulling my hair out trying to solve this for hours.
Hi Adam, I made a sprinkler control system using inpout32 and a parallel relay controller here:
http://www.ezsprinkle.com
I started using the app on a Win7x64 box and discovered my little program wouldn’t work. To fix it I’ve moved on to WinRing0 and found it to be a simple, reliable solution. My controller waters 6 stations around my yard all controlled from the HTPC.