Below is code I am using with python. Note that inpout32.dll which can be found here is present in the same directory.
import ctypes
ctypes.windll.inpout32.Out32(0x300, 40)
print ctypes.windll.inpout32.Inp32(0x300)
The code should input 40 in the address of 300, however when I try to read the value at address 300 I get 255 no matter what I input. The code does however work when I use 378 as an address(LPT1).
Edit Just so everyone is aware, I am trying to do this to use an input/output board on a 104pc