Python in Physics
OSU logo
The content of this page is undergoing revision and will be moved to another site soon.
Parallel Port

Table of Contents

About Printer Ports

Windows

  • Download inpout32.dll and place in the c:\windows\system32 directory. You will need to be an administrator.
  • Reading from and writing to data, control and status ports can be accomplished in Python using the ctypes module. A function invocation such as ctypes.windll.inpout32.Out32(0x37c, byte) uses the ctypes windll method to access the Out32 function of inpout32.dll. The byte is written to the IO address 37c in hex.
  • This module has a parallel port class with read, write and convert/eoc handshaking functions for an ADC as well as test routines for these functions: printer_port_io.py (updated 7 May at 15:06). Data taken with the fast block read routine and the Max 153 ADC: 50 Hz 3 Volt signal data and plot as pdf; 100 Hz 3 Volt signal data and plot as pdf. Plot them with plot_data_file.py. Notice the non-random noise.