如何在 raspberry / raspbian 上观看自动启动 python 脚本?

How to watch an automatically startet python script on raspberry / raspian?

在我的 Pi 上(上面只有精简版文本 Linux)一个 Python-程序是通过 rc.local 启动的!当我登录(无头)Pi 时,我看不到程序的输出(简单的打印命令)。当我使用 "pa -S" 和 "top" 时,我可以看到 Python3 是 运行,但我无法切换到程序的输出。

如何使输出在终端中可见-window 就像我直接从命令行启动程序时一样?

感谢和欢呼,

乌尔里希

你不能那样做,你必须使用重定向将输出写入文件。 在rc.local中可以这样写:your_program >> logfile_name 2>&1 但有时必须删除日志文件。 搜索 [linux] redirection