消失的Python通知弹出窗口

编程入门 行业动态 更新时间:2024-10-27 18:32:27
本文介绍了消失的Python通知弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有一种方法可以创建弹出窗口,该弹出窗口会在一定秒数或几分钟后消失.我只发现一些人遇到弹出窗口麻烦,而弹出窗口在不应该出现的情况下会消失.

Is there a way to create a pop up that disappears after a certain number of seconds or minutes. I only find examples of people having trouble with popups that disappear when they are not supposed to.

我找到了tkMessage框,但是当我用show info测试某些东西时,它给了我两个框,您必须单击以退出它.真让人分心.

I have found tkMessage box but when I test something with show info it is giving me two boxes and you have to click to get out of it. It's quite distracting.

我宁愿有一些消失的东西,例如,python程序看到新的电子邮件已经到来,然后创建一个弹出窗口,该弹出窗口具有颜色和一些文本且不会分散注意力. 60秒后消失.

I'd rather have something that disappears, for example, the python program see's that a new email has arrived in and then creates a pop up, which has colour and some text and not distracting. Disappearing after say 60 seconds.

推荐答案

您可以使用tkinter自己轻松创建弹出窗口:

You can easily create a pop-up yourself with tkinter:

import tkinter as tk root = tk.Tk() root.title("info") tk.Label(root, text="This is a pop-up message").pack() root.after(5000, lambda: root.destroy()) # time in ms root.mainloop()

更多推荐

消失的Python通知弹出窗口

本文发布于:2023-08-06 02:14:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1309456.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出窗口   通知   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!