Python访问并行端口
我一直在尝试使用 pyParallel 访问并行端口,它与 PySerial 位于同一 sourceforge 中:
http ://sourceforge.net/projects/pyserial/files/
我收到一个 WidowsError: 异常: 特权指令。有人用过这个模块吗?
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的 - 正如我在评论中思考的那样,这都是关于当今 Windows 版本中更好的沙箱 - 有一个讨论 这里。 这里还有一个可能的解决方案(至少对于 XP,如果您有较新的 Windows 版本,则需要尝试一下)此处。我无法尝试,因为我没有任何 Windows,但我希望它能有所帮助!
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!
我对被接受的答案没有运气。
但是,这个安装程序一次性解决了我的问题,无需摆弄驱动程序:
http: //sourceforge.net/projects/pyserial/files/pyparallel/giveio/
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/