Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to make the Dragon Boat Festival healthy pop-up window that can't be closed?

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use Python to make the Dragon Boat Festival Ankang pop-up window that can not be closed. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

For learning and reference only

Dragon Boat Festival is also known as Dragon Boat Festival, Dragon Boat Festival, double Boat Festival, Dragon Festival, Zhengyang Festival, Tianzhong Festival and so on. Dragon Boat Festival originates from celestial phenomena worship and evolved from dragon sacrifices in ancient times. It is said that qu Yuan, a poet of the State of Chu during the warring States period, jumped into the Miluo River on May 5 to commit suicide. Later, people also regard Dragon Boat Festival as a festival to commemorate qu Yuan. During the Dragon Boat Festival, when people greet each other, they usually say that the Dragon Boat Festival is healthy, but rarely say that the Dragon Boat Festival is happy. How to use Python to make Dragon Boat Festival Ankang pop-up window, window creation, we use tkinter library to achieve, the overall implementation of the code is relatively simple As follows: def dow (): t = tk.Tk () width = t.winfo_screenwidth () height = t.winfo_screenheight () a = random.randrange (0, width) b = random.randrange (0, height) t.title ('Dragon Boat Festival Ankang') t.geometry ('200x50' +' + str (a) +'+'+ str (b)) tk.Label (t, text=' Dragon Boat Festival Ankang!' , bg='Green', # background color font= ('italics', 17), # font and font size width=15 Height=2 # label length and width) .pack () t.mainloop () threads = [] for i in range (10): # number of pop-ups required t = threading.Thread (target=dow) threads.append (t) time.sleep (0.1) threads [I] .start ()

Take a look at the effect:

When we run the program, we will generate a pop-up window, if we click close, instead of closing it, more windows will pop up, isn't it a bit rogue. So if we want to finish, we have to end the running program instead of constantly clicking the close button of the window, because that will fill our entire computer screen. This is the end of the article on "how to use Python to make an unclosed Dragon Boat Festival Ankang pop-up window". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report