Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

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

Shulou Source: shulou.com Published: 2022-06-01 13:41:26 10月03日 Update

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.

Tags: Ankang production more articles people fonts programs qu Yuan reference run good practical happy constantly between code legends content also known as size Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MariaDB OPPO Reno Redmi Microsoft