简体   繁体   English

Python访问并行端口

[英]Python Access Parallel Port

I've been trying to access the parallel port with pyParallel, which is in the same sourceforge as PySerial: 我一直在尝试使用pyParallel访问并行端口,该端口与PySerial在同一sourceforge中:

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

I'm getting a WidowsError: exception: priviledged instruciton. 我收到WidowsError:异常:特权指令。 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

Yep -- as I pondered in my comment, it's all about better sandboxing in today's Windows versions -- there's a discussion here . 是的-正如我在评论沉吟,它是所有关于今天的Windows版本更好的沙盒-有一个讨论在这里 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 . 还有一个可能的解决方案在这里 (至少到XP,你需要尝试,如果你有一个较新的Windows版本),用Python的例子在这里 I can't try it out since I don't have any Windows around, but I hope it can help! 由于周围没有Windows,因此无法尝试,但希望它能对您有所帮助!

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/ http://sourceforge.net/projects/pyserial/files/pyparallel/giveio/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM