1

我正在尝试在命令提示符下使用“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>

请帮忙。

亲切的问候

4

0 回答 0