Interactive shell to a running Python process
1–10 of 23 posts
Re: Interactive shell to a running Python process
#2You can also run an RPyC* server in your process, and connect to it from any Python shell on any computer to control it.
Re: Interactive shell to a running Python process
#3This is great I thought Ipython was great. But this is awesome.
Re: Interactive shell to a running Python process
#4My most excellent friend Thomas Hurst implemented a remote python shell a few years ago, for use in debugging running instances of Terminator.
You can see the code in question here:
http://bazaar.launchpad.net/~gnome-terminator/terminator/tru...
and how it gets set up, starting at line 88, here:
http://bazaar.launchpad.net/~gnome-terminator/terminator/tru...
Re: Interactive shell to a running Python process
#5What are the consequences of running this in production? What's the performance hit like, is it unsafe, etc.?
Re: Interactive shell to a running Python process
#6Would it be possible to use gdb or something similar to inject this into a running process?
Re: Interactive shell to a running Python process
#7If you want to do the same without modifying the script (or if you have the script already running without the needed import for the remote debugging possibility), i.e. inject into a running process:
Re: Interactive shell to a running Python process
#8I wanted something like this back in the day to be able to poke around in the EVE Online client. Nice job!
Re: Interactive shell to a running Python process
#9Very interesting. I would love to see this for other programming languages, especially Ruby (probably fairly easy) or Objective-C (may be quite hard).
Re: Interactive shell to a running Python process
#10Would it be possible to use gdb or something similar to inject this into a running process?
Yes, pyrasite does just that with a python wrapper around the gdb commands.
https://fedorahosted.org/pyrasite/
It was discussed here: