0

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
PPTim
  • 1,346
  • 6
  • 18
  • 33
  • http://stackoverflow.com/questions/89607/what-is-a-privileged-instruction – Bertrand Marron May 31 '10 at 17:54
  • I used it a very, very long time ago, on some already-old-at-the-time OS, maybe Win'98. What version of Windows are you using? Recent versions have been tightening security down for many years now (and no bad thing either;-), which might explain the problem (though not necessarily suggest a solution... if your version of Windows just won't let a user-mode program perform an input operation from a parallel port's control register, it's far from obvious how you can achieve that goal). – Alex Martelli May 31 '10 at 17:57

2 Answers2

1

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
  • 854,459
  • 170
  • 1,222
  • 1,395
  • 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 May 31 '10 at 18:19
  • @PPTim, you're welcome -- fingers crossed and wishing you best of luck! – Alex Martelli May 31 '10 at 19:03
0

I had no luck with the accepted answer.

However, this installer solved the problem for me in one shot, no fiddling with drivers:

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

manimino
  • 1,265
  • 1
  • 11
  • 11