微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在命令提示符中使用“python -m twisted.conch.stdio”命令时出错

如何解决在命令提示符中使用“python -m twisted.conch.stdio”命令时出错

我正在尝试在命令提示符下使用“python -m twisted.conch.stdio”命令,但它不起作用并出现以下错误

C:\Users\Melanie>python -m twisted.conch.stdio
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py",line 193,in _run_module_as_main
    "__main__",mod_spec)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py",line 85,in _run_code
    exec(code,run_globals)
  File "C:\Users\Melanie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\python37\site-packages\twisted\conch\stdio.py",line 11,in <module>
    import os,tty,sys,termios
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\tty.py",line 5,in <module>
    from termios import *
ModuleNotFoundError: No module named 'termios'

我希望最终能够跑步:

>>> from twisted.names import client
>>> client.getHostByName('www.example.com')
<Deferred at 0xf5c5a8 waiting on Deferred at 0xf5cb90>
>>> _
<Deferred at 0xf5c5a8 current result: '2606:2800:220:6d:26bf:1447:1097:aa7'>

>>> client.lookupMailExchange('twistedmatrix.com')
<Deferred at 0xf5cd40 waiting on Deferred at 0xf5cea8>
>>> _
<Deferred at 0xf5cd40 current result: ([<RR name=twistedmatrix.com type=MX class=IN ttl=1s auth=False>],[],[])>

目的是获得前面代码显示的延迟响应,但我得到的是:

>>> from twisted.names import client
>>> client.getHostByName('www.example.com')
<Deferred at 0x263d27b9dc8 waiting on Deferred at 0x263d27b9f48>
>>> _
<Deferred at 0x263d27b9dc8 waiting on Deferred at 0x263d27b9f48>
>>> client.lookupMailExchange('twistedmatrix.com')
<Deferred at 0x263d27c6a88 waiting on Deferred at 0x263d27c6c08>
>>> _
<Deferred at 0x263d27c6a88 waiting on Deferred at 0x263d27c6c08>

请帮忙。

亲切的问候

M

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。