Python twisted manhole that works like ipython or similar

你。 提交于 2019-12-11 03:12:03

问题


Running this I found off the web

#manhole
from twisted.internet import reactor
from twisted.manhole import telnet
def createShellServer( ):
    print 'Creating shell server instance'
    factory = telnet.ShellFactory()
    port = reactor.listenTCP( 2000, factory)
    factory.namespace['x'] = application
    factory.namespace['s'] = s
    factory.username = 'me'
    factory.password = 'me'
    print 'Listening on port 2000'
    return port

This worked, I was able to manhole into my twisted application. But I can't up-arrow to get the previous commands, nor does it have any tab completion. I think just being able to go through the history would be a big help.

This is very new stuff to me. So I think I could be using an old method to manhole in. Any help is appreciated.


回答1:


You're using the old, deprecated, essentially unmaintained implementation of manhole.

Instead, you should be using the one included in Twisted Conch. You can find examples of its use along with the other Twisted Conch examples.



来源:https://stackoverflow.com/questions/24296807/python-twisted-manhole-that-works-like-ipython-or-similar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!