简体   繁体   中英

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'?

Thx

You are looking for the wall BSD function.

NAME wall -- write a message to users

SYNOPSIS wall [-g group] [file]

DESCRIPTION The wall utility displays the contents of file or, by default, its standard input, on the terminals of all currently logged in users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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