views:

107

answers:

1

Hi,

I've been trying to access the parallel port with pyParallel, which is in the same sourceforge as PySerial:

http://sourceforge.net/projects/pyserial/files/

I'm getting a WidowsError: exception: priviledged instruciton. Has anyone used this module before?

import parallel 
p = parallel.Parallel()
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python26\lib\site-packages\parallel\parallelwin32.py", line 74, in __init__
    self.ctrlReg = _pyparallel.inp(self.ctrlRegAdr)
WindowsError: exception: priviledged instruction
+1  A: 

Yep -- as I pondered in my comment, it's all about better sandboxing in today's Windows versions -- there's a discussion here. There's also a possible solution here (at least up to XP, you'll need to try it if you have a newer Windows version) with a Python example here. I can't try it out since I don't have any Windows around, but I hope it can help!

Alex Martelli
thanks for the links and answer. Looks like this will be a little harder than pySerial. The idea was to use just one or two pins of the parallel port (and ground) to read in an input and signal an Adruino board. Hopefully input32.dll will be a useable solution. Thanks!
PPTim
@PPTim, you're welcome -- fingers crossed and wishing you best of luck!
Alex Martelli