0
点赞
收藏
分享

微信扫一扫

Python 发送 WIN 10 通知消息


文章目录

  • ​​Python 发送 WIN 10 通知消息​​
  • ​​1、安装库​​
  • ​​2、编写代码​​

Python 发送 WIN 10 通知消息

1、安装库

pip install win10toast

2、编写代码

from win10toast import ToastNotifier
import _thread
from time import sleep

"""
win10toast 的库底层为win32api、win32con和win32gui
"""

toaster = ToastNotifier()


def show_toast():
toaster.show_toast("通知标题",
"通知内容",
icon_path=None,
duration=5,
threaded=True)


def send():
_thread.start_new_thread(show_toast, ())
sleep(0.1)


if __name__ == '__main__':
send()

运行即可

举报

相关推荐

0 条评论