首页 > 解决方案 > Python 如何在 Ubuntu/Linux 中读取分离屏幕会话的标准输出?

问题描述

在 Ubuntu 系统上运行的 Python 脚本如何读取screen会话中运行的程序的标准输出?

screen

## Now inside screen session...

./run_something

## Detach from screen...

python readScreenStdout.py     <--- can this script read the output to the screen session?

标签: pythonlinuxpython-3.xubuntustdout

解决方案


看来您想使用screen -L日志记录或 tmuxshow-bufferpipe-pane(或可能capture-pane)。

Soupso通过命名管道获得了很好的结果。


推荐阅读