<p style="max-width: 100%;min-height: 1em;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;caret-color: rgb(62, 62, 62);letter-spacing: 1px;color: rgb(0, 0, 0);box-sizing: border-box !important;overflow-wrap: break-word !important;">点上方“</span><span style="max-width: 100%;letter-spacing: 0.544px;caret-color: rgb(62, 62, 62);color: rgb(0, 122, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong mpa-from-tpl="t" style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 1px;box-sizing: border-box !important;overflow-wrap: break-word !important;">菜鸟学Python</span></strong></span><span style="max-width: 100%;caret-color: rgb(62, 62, 62);letter-spacing: 1px;color: rgb(0, 0, 0);box-sizing: border-box !important;overflow-wrap: break-word !important;">”,选择“</span><span style="max-width: 100%;caret-color: rgb(62, 62, 62);letter-spacing: 1px;color: rgb(255, 120, 0);box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">星标</strong></span><span style="max-width: 100%;caret-color: rgb(62, 62, 62);letter-spacing: 1px;color: rgb(0, 0, 0);box-sizing: border-box !important;overflow-wrap: break-word !important;">”</span></span></p><section style="max-width: 100%;white-space: normal;color: rgb(0, 0, 0);text-align: left;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><p style="max-width: 100%;min-height: 1em;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.544px;caret-color: rgb(62, 62, 62);box-sizing: border-box !important;overflow-wrap: break-word !important;">第475篇原创干货</span></strong><span style="max-width: 100%;letter-spacing: 0.544px;caret-color: rgb(62, 62, 62);box-sizing: border-box !important;overflow-wrap: break-word !important;">,第一时间送达</span></span></p><p style="text-align: center;"><img class="rich_pages" data-galleryid="" data-ratio="0.5054945054945055" data-s="300,640" data-type="png" data-w="1092" style="" src="https://www.zkxjob.com/wp-content/uploads/2022/07/wxsync-2022-07-b3220a0e5109bbfab397a5b7da96fcc8.png" /></p><p style="max-width: 100%;min-height: 1em;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.544px;caret-color: rgb(62, 62, 62);box-sizing: border-box !important;overflow-wrap: break-word !important;"></span></span><br /></p></section></section></section></section></section></section></section></section></section></section></section>
在大家日常的学习和生活中,都离不开电脑办公,有时候坐在电脑前,会连续工作几个小时。科学研究表明,当大家进行电脑办公时,需要每隔半个小时,就要花两三分钟来放松自己的眼睛。但是对于大家来说,有时候会因工作的忙碌而忘掉,手机设置闹钟也是非常麻烦的。
因此小编今天就同大家分享一款利用Python制作的定时小姐姐语音提示软件,提醒大家定时进行休息,自己动手做一个小软件,会更香!
01.效果展示
小编已经将程序打包为exe软件,我们首先来运行一下软件,来看一下软件运行的效果吧。
02.程序讲解
通过视频的展示,可以看到,软件运行的环境是基于win10系统,软件运行后,会定时的弹出消息通知,并有小姐姐的语音来提示用户要注意休息,通过这样的软件,就可以提醒电脑用户定时进行休息。这样小巧实用的软件,在程序的实现上也仅仅需要20行代码即可完成。一起来看看吧。
对于程序部分的讲解,可以分为以下的两个部分:
-
系统消息通知
-
语音播放
03.系统消息通知
对于系统消息的通知 ,可以利用win10toast库来实现,其程序如下图所示。
程序中,在run函数中,首先创建一个ToastNotifier对象,然后调用成员函数show_toast来实现系统消息的通知。其中msg参数显示的文本内容,是通过famousQuotes函数所抓取的名人名言信息。参数duration表示的是弹窗的显示时长。函数运行后其效果如下图所示。
程序运行后,在桌面的右下方会弹出系统的提示消息,消息通知中显示的是我们抓取到的文本信息。
04.语音播放
对于语音的播放,程序利用的是小巧的playsound库来实现,对于语音的播放仅需两行代码即可完成。
这样即可完成对于提示语音的播放。
05.打包细节
对于程序的打包,我们采用的是pyinstaller库来进行实现,由于程序所使用的是python3.6的版本,因此大家在利用pyinstaller进行打包时,也尽可能的在python3.6的环境下进行打包,防止在打包过程中出现某些文件的缺失。
上图中,在程序打包时,需要先跳转到程序的根目录下,然后执行pyinstaller -F -w -i clock.ico main.py
的命令。其中:
程序运行后,如果大家想要停止程序的运行,可以打开任务管理器后,在当前的进程中,找到我们的软件,然后点击“结束任务”,结束我们的软件。
06.总结
以上就是小编今天为大家带来的语音小姐姐的定时提醒软件,大家可以下载打包好的程序进行定时提醒,大家拿到源码之后可以自己修改,制作一个志林版本,或者制郭德纲版本,一定惊呆你隔壁的同事!
如何获取源码和软件:
在下面的「菜鸟学Python」后台输入:小助手,找他领取,暗号:语音
<p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" /></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;">推荐阅读:</span></strong></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;">入门: </span><span style="max-width: 100%;color: rgb(2, 30, 170);text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">最全的零基础学Python的问题</span><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;"> | </span><span style="max-width: 100%;color: rgb(2, 30, 170);text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">零基础学了8个月的Python </span> <span style="max-width: 100%;color: rgb(2, 30, 170);text-decoration: underline;font-size: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;">|</span> <span style="max-width: 100%;text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">实战项目</span> <span style="max-width: 100%;text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">|学Python就是这条捷径</span></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" /></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;">干货:</span><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);text-decoration: underline;box-sizing: border-box !important;overflow-wrap: break-word !important;">爬取豆瓣短评,电影《后来的我们》</span> | <span style="max-width: 100%;font-size: 14px;text-decoration: underline;box-sizing: border-box !important;overflow-wrap: break-word !important;">38年NBA最佳球员分析 </span><span style="max-width: 100%;font-size: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;text-decoration: underline;box-sizing: border-box !important;overflow-wrap: break-word !important;">|</span> </span><span style="max-width: 100%;font-size: 15px;text-decoration: underline;box-sizing: border-box !important;overflow-wrap: break-word !important;">从万众期待到口碑扑街!唐探3令人失望</span> | 笑看新倚天屠龙记 | 灯谜答题王 |<span style="max-width: 100%;font-size: 14px;text-decoration: underline;box-sizing: border-box !important;overflow-wrap: break-word !important;">用Python做个海量小姐姐素描图 |</span></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" /></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 15px;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;">趣味:</span><span style="max-width: 100%;color: rgb(2, 30, 170);text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">弹球游戏</span> | <span style="max-width: 100%;text-decoration: underline;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">九宫格</span> | 漂亮的花 | 两百行Python《天天酷跑》游戏!</p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" /></p><p style="max-width: 100%;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;text-size-adjust: auto;text-align: left;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;color: rgb(2, 30, 170);box-sizing: border-box !important;overflow-wrap: break-word !important;">AI:</span> 会做诗的机器人 | 给图片上色 | 预测收入 | 碟中谍这么火,我用机器学习做个迷你推荐系统电影</p>
年度爆款文案
-
1).卧槽!Pdf转Word用Python轻松搞定!
-
2).学Python真香!我用100行代码做了个网站,帮人PS旅行图片,赚个鸡腿吃
-
3).首播过亿,火爆全网,我分析了《乘风破浪的姐姐》,发现了这些秘密
-
4).80行代码!用Python做一个哆来A梦分身
-
5).你必须掌握的20个python代码,短小精悍,用处无穷
-
6).30个Python奇淫技巧集
-
7).我总结的80页《菜鸟学Python精选干货.pdf》,都是干货
-
8).再见Python!我要学Go了!2500字深度分析!
-
9).发现一个舔狗福利!这个Python爬虫神器太爽了,自动下载妹子图片
本篇文章来源于: 菜鸟学Python
本文为原创文章,版权归知行编程网所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Python 中的 val() 是什么意思?08/19
- ♥ 如何在python中包装输出08/17
- ♥ 如何在python中使用返回函数?12/18
- ♥ 武大学生用Python敲出樱花开放04/24
- ♥ python如何定义用户输入12/03
- ♥ python scrapy.Request 发送请求的方式11/10
内容反馈