python:具有交互python外壳的扭曲应用程序 [英] python: twisted app with interacive python shell

查看:108
本文介绍了python:具有交互python外壳的扭曲应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能编写一个扭曲的应用程序来打开交互式外壳,例如调整通过扭曲协议层提供服务的业务对象?

Would it be possible to write a twisted-powered application that opens an interactive shell, e.g. to tweak the business objects served via the twisted protocol layer?

我目前的问题是reactor.run()阻止了应用程序,并且IPython.embed()仅在反应堆完成后运行.

My current problem is that the reactor.run() blocks the application, and the IPython.embed() is only run after the reactor has finished.

推荐答案

除非您特别需要仅在ipython中提供的其他功能,否则您确实应该查看示例代码)

Unless you specifically need extras that are only in ipython, you really should check out manhole (twistedmatrix example code)

它使您可以访问本地在扭曲反应堆中运行的python交互式外壳.通常,可以通过telnet或ssh访问该shell,但是如果您想发挥创造力,则可以按照自己的方式进行连接.

It lets you access a python interactive shell that is natively running in the twisted reactor. Normally the shell is accessed via telnet or ssh, but if you wanted to be creative you could wire it up any way you want.

这篇关于python:具有交互python外壳的扭曲应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆