【发布时间】:2018-11-22 13:05:10
【问题描述】:
我有一个在 Ubuntu 中完美运行的脚本,但是我希望让它在 Windows 机器上运行,以便在生产环境中使用。该脚本的一般用途是对 PCB 进行编程。
我在研究和调整这部分代码时遇到了问题:
try:
fd = serial.Serial(Port, Baud) #Opens the specified port
child = pexpect.fdpexpect.fdspawn(fd, timeout=180)
except:
input('There has been an error making the connection, check your connections and try again\nPress enter to exit')
sys.exit()
input('Press enter to continue, then apply 24V power to the unit')
存在的问题:
child = pexpect.fdpexpect.fdspawn(fd, timeout=180)
非常感谢任何建议或修改!
【问题讨论】:
标签: python windows pyserial pexpect