使用"win10toast"向win10发送消息

编程开发   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2021-7-19

01 :准备工具
安装win10toast库
点击Terminal进入黑窗口

输入"pip install win10toast"回车

我这个是已经安装过了,所以可能跟你们的不一样
需要等待一下下,然后就安装成功了

==============================================

安装完成后 从win10toast导入ToastNotifier
"from win10toast import ToastNotifier"
(下面这两个是我爬虫用的,请无视)

toaster = ToastNotifier() 创建一个ToastNotifier对象


准备工作完成!

02 :发送消息
toaster.show_toast("我是标题~", "我是内容~",
duration=10)

使用show_toast传入几个参数
show_toast可以传入5个参数
title、msg、icon_path、duration、threaded

title是消息的标题,有默认值
msg是消息的主题,有默认值
icon_path是消息的图标,默认是python图标
duration是消息显示时间(?),默认5秒钟
threaded不知道有什么用,有知道的可以告诉我

[太开心]成功~

成为第一个回答人

评论

登录后才可发表内容
  • 主题

    2

  • 帖子

    37

  • 关注者

    0

Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:0.0535s Mem:2044Kb