0

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!

1
  • I plan to write some not-so-trivial scripts in that environment, and there is no way that I'm able to instantiate and editor there (can't even get window handles sadly) so its either writing a full IDE or doing this. This will be much cheaper if a compatible editor exists. Commented Apr 20, 2011 at 20:45

1 Answer 1

0

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?

Sign up to request clarification or add additional context in comments.

1 Comment

I am running with IronPython instead of regular python, which means that wxWidgets is unavailable (no CPython bindings), so PyCrust will be impossible. I really have zero access to any GUI/windowing library from my running environment, which is why I want to inject commands via a listening socket/pipe.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.