简体   繁体   English

Python如何在Ubuntu / Linux中读取分离屏幕会话的Stdout?

[英]How can Python Read the Stdout of a Detached screen Session in Ubuntu/Linux?

How can a Python script running on an Ubuntu system read the Stdout of a program that is running in a screen session? 如何在Ubuntu系统上运行的Python脚本读取在screen会话中运行的程序的Stdout?

screen

## Now inside screen session...

./run_something

## Detach from screen...

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

It appears you want to use screen -L logging, or tmux show-buffer or pipe-pane (or possibly capture-pane ). 您似乎想要使用screen -L logging,或tmux show-bufferpipe-pane (或可能是capture-pane )。

Soupso obtained good results via a named pipe . Soupso 通过命名管道获得了良好的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM