可以连接远程环境的Python编辑器?
我在应用程序中设置了一个交互式 python 环境。我可以输入命令,它们将在其中执行,并可以访问那里的变量。
问题是我编写了一个半途而废的编辑器,只允许这样做。它没有命令历史记录、代码完成等,因为我没有编写完整的 IDE。但是,我希望能够使用精美的编辑器在该环境中编写代码。
我认为它可以解决的方法是,编辑器将具有用于远程Python会话的接口/协议,并且我只需要在我的应用程序中实现一个服务器(而不是简单的编辑器)并且能够连接和运行代码。
我可以实现我必须实现的任何接口或协议,但我找不到定义了此类协议的 IDE(或者插入充当客户端的扩展的简单方法)。
本质上,我想要一个 python 编辑器,它可以选择在命令(可以是多行)完成输入时调用函数 x,并在发生自动完成请求时调用另一个函数 y。 我检查了一些编辑器,但找不到这样的功能。有谁知道这样的事情吗?它实际上不必是一个Python编辑器,只需支持我需要的钩子即可。
谢谢!
I set up an interactive python environment in an application. I can input commands and they will execute inside it, having access to the variables that live there.
The problem is that I coded a half-assed editor that allows only that. It doesn't have command history, code completion etc, because I didn't code a full IDE. However, I would like to be able to write code in that environment with a fancy editor.
The way I think it can work out is that an editor will have an interface/protocol for remote python sessions, and I will just have to implement a server in my application (instead of the simple editor) and be able to connect and run code.
I can implement any interface or protocol that I have to, but I can't find an IDE that has such a protocol defined (or an easy way to plug an extension that will serve as the client side).
Essentially, I want a python editor that has an option to call a function x whenever a command (can be multiline) finished typing, and another function y when an autocomplete request occurs.
I checked out some editors but couldn't find such a feature. Does anyone know of such a thing? It actually doesn't have to be a python editor, just support the hooks that i need.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试将 PyCrust 集成到您的应用程序中?请参阅这个SO问题
在Python程序中嵌入Python shell
rpyc 听起来可能对您有用。 rpyc 在其最新版本中添加了对 IronPython 的支持。 PyScripter 支持 rpyc。也许这就是您正在寻找的组合?
Did you try integrating PyCrust into your application? See this SO question
Embedding a Python shell inside a Python program
rpyc sounds like something which could be useful to you. rpyc added support for IronPython in their latest release. PyScripter supports rpyc. Maybe this is the combo you are looking for?