python有pty这个模组可以创建虚拟串口,结果在win10下执行import pty,结果报错:
>>> import pty
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python\Python36\lib\pty.py", line 11, in <module>
import tty
File "C:\Python\Python36\lib\tty.py", line 5, in <module>
from termios import *
ModuleNotFoundError: No module named 'termios'
搜了下,说termios是Linux下用到的,win10没用。但我win10报这个错误该如何解决?
最近编辑记录 Gentlepig (2020-07-10 14:49:45)
离线
https://whycan.cn/t_3294.html
https://whycan.cn/t_3722.html
https://whycan.cn/t_3724.html
E:\Python37\python.exe -m pip install termios
离线
> pip search termios
pycopy-termios (0.0.0) - Dummy termios module for Pycopy
micropython-termios (0.0.0) - Dummy termios module for MicroPython
搜到了两个相关的,不过感觉应该不是。
搜pty发现如下:
The pty module defines operations for handling the pseudo-terminal concept: starting another process and being able to write to and read from its controlling terminal programmatically.
Because pseudo-terminal handling is highly platform dependent, there is code to do it only for Linux. (The Linux code is supposed to work on other platforms, but hasn’t been tested yet.)
如果pty在win下不能用的话,那么win10下有没有其它的python可用的可创建虚拟串口的模组?
最近编辑记录 Gentlepig (2020-07-10 16:00:00)
离线