On Linux, you can use Python subprocess
modules to call system commands notify-send
to pop up message windows. notify-send
It is a command line program that comes with the Linux system and is used to send notifications to the desktop. The following is a sample code that uses subprocess
the module call notify-send
command to pop up a message window:
pythonCopy code
import subprocess # 弹出消息窗体 subprocess.run(['notify-send', 'Title', 'Message'])
Among them, "Title"
is the title of the message form, "Message"
and is the content of the message form. Running this code on a Linux system will pop up a system-level message window.