rconsole - Remote Python Console
rconsole is a new Python console that you can attach to a running script to inspect and modify its namespace. I hacked it up since I did not find a simple to use alternative to inspect a daemon process.
rconsole is included with the rfoo package at http://code.google.com/p/rfoo/.
To invoke it within a script add the following to its code:
from rfoo.utils import rconsole rconsole.spawn_server()
To attach from another shell do:
$ rconsole
rconsole is not a debugger and does not freeze the script. You can think of it as a window into the belly of a long running script. It is lightweight and non-disruptive. You may leave it inside production code and attach when you need to check in on the health of a long running script:
- Import guppy.hpy into a running script to investigate memory leaks.
- Change function definitions and reload modules on the fly.
- Inspect live internal data structures.
Winpdb - A Platform Independent Python Debugger
How do I spawn server on a different port?
Do the data structures have to be global to be able to see them?
I’d like to use rfoo to spawn processes on remote servers, processes that access the remote file system and may in turn spawn other processes. Is that possible?
I don’t want to use a py-win solution as I have Linux servers in my environment also. In addition, I like the fact that you can see your remote namespace via rconsole and you can get some data back to the client… In addition, I don’t want to use xml-rpc because I want the rpc interface to be seamless.