Python REPL to start a process

I am currently developing a simple python application that connects to a server. This is currently single-threaded (since multithreading is currently not required).

However, I would like - for debugging, maintenance, etc. also be able to have REPL via stdin.

How can I do this, if possible? Do I need to remember anything? Should I make a separate thread for this?

+5
source share
3 answers

Maybe this question may help. You can modify it a bit to create a customized REPL.

+1
source

You either need to not block or use a thread.

Twisted concurrency, REPL-, .

+3

rfoo. README:

rconsole - bundled with the rfoo package there is a remote Python console with automatic completion, which can be used to check and change the script namespace.

To activate in a script, run:

from rfoo.utils import rconsole
rconsole.spawn_server()

To install from the shell, do:

$ rconsole

SECURITY NOTE:
The rconsole listener launched using spawn_server () will accept any local ones and therefore may be unsafe for use on shared hosting or similar environments!

0
source

All Articles