[英]Raspberry Pi & Python 2.7 - trying to print to all users
I have a program that runs when the Pi is booted. 我有一个程序在树莓派启动时运行。
The print statements are not displaying on additional terminal sessions. 打印语句未显示在其他终端会话上。
I can only get the print statements when I kill the auto-booted process and restart the program. 我只有在终止自动启动的进程并重新启动程序后才能获得打印语句。
Is there a method to broadcast print messages to all users - like the message displayed then typing 'Halt'? 有没有一种方法可以向所有用户广播打印消息,例如显示的消息然后键入“ Halt”?
Thx 谢谢
You are looking for the wall
BSD function. 您正在寻找
wall
BSD功能。
NAME wall -- write a message to users
NAME墙-给用户写一条消息
SYNOPSIS wall [-g group] [file]
内容提要[-g组] [文件]
DESCRIPTION The wall utility displays the contents of file or, by default, its standard input, on the terminals of all currently logged in users.
描述wall实用程序在所有当前登录用户的终端上显示文件或默认情况下的标准输入内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.