python - 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?
解决方案
看来您想使用screen -L
日志记录或 tmuxshow-buffer
或pipe-pane
(或可能capture-pane
)。
Soupso通过命名管道获得了很好的结果。
推荐阅读
- amazon-web-services - API连接到私有子网中的redshift?
- perl - 如何将时间戳四舍五入到最接近的 5 分钟值
- authorize.net - Authorize.net 网关:事件 ID 为:N/A
- amazon-web-services - 只有创建者用户才能从 kubectl 管理 AWS kubernetes 集群 (EKS)?
- php - 为什么下载的文件是0字节?
- .net-core - 在 VS2017 的 .NET 核心项目中发布时创建 exe
- javascript - 如何从控制器获取 AJAX 响应到 jsp
- c++ - 使用 Char 数组作为通用变量以供多种用途
- javascript - 同一对象构造函数的不同实现不适用于谷歌脚本
- python - 我的代码中查找素数列表的错误是什么