Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python REPL for a running process

Tags:

I am currently developing a simple application in python that connects to a server. At the moment, it's single-threaded (as multithreading is not currently required).

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

How do I go about that, if possible? Will I need to keep anything in mind? Will I have to make a separate thread for it?

like image 477
cwj Avatar asked Jun 04 '09 10:06

cwj


1 Answers

You either need to go non-blocking or use a thread.

I would personally use Twisted for concurrency, which also offers a REPL-protocol which is easy to integrate.

like image 51
mthurlin Avatar answered Oct 20 '22 01:10

mthurlin