Bind a new terminal to rich console

68 views Asked by At

I'm using rich library for formatting a live console window in Linux to show the progress of some tasks. I want to start a new terminal from within Python, and provide that context to rich somehow so it can update the provided console. Of course, if I run the Python file from a terminal, the current terminal context is passed by default, and the layout is rendered right there. But since this "GUI" needs to run as a service, how can I achieve the same?

So far I've been starting a new terminal and then running my script, but this makes me lose so much control over the GUI application. Here is the command I'm using via systemd service

gnome-terminal --window --maximize -- sudo bash -c 'export PYTHONPATH="<path to project>" && /usr/bin/python3 -m station_gui.station_gui'
0

There are 0 answers