Closed seisatsu closed 7 years ago
I could also use plain old sockets. It's seems it's also possible to run an interactive Python console over a socket, which might be the cleanest way to pull this off. See http://stackoverflow.com/questions/16155480/no-newlines-for-python-interactive-console-over-socket
Ooh I just had a crazy thought where we have an ncurses CLI. The bottom line of your terminal screen is a command prompt and the top lines are a message window where all normal log messages are sent.
I like that, though we'll have to make it support Windows as well. It's a straightforward solution. We should also support logging to file then since piping stdout becomes impossible.
We can add colors & bold to log messages.
A simple two-pane approach should be easy to code for both ncurses and windows console to support both.
If enabled in the configuration or command line, pressing tilda will open a console at the top of the window where arbitrary python commands may be executed.
Alternative idea: The engine creates a bi-directional named pipe or other ipc bridge which can be accessed with a tool to send python commands and receive responses.
Investigate multiprocessing module's Clients and Listeners.