猫史档案馆


【Python作品分享】新的作品嗨害嗨【作品秀】

用户:调皮的皮皮蟹gLBB调皮的皮皮蟹gLBB查看:0 回复:1 评论:0 创建时间:2022-09-14T08:36:49


【作品展示】

center_image

 

【作品介绍】

你可以试着点开

 

【作品源代码】

import tkinter as tk
import random
import threading
import time
def boom():
    window = tk.Tk()
    width = window.winfo_screenwidth()
    height = window.winfo_screenheight()
    a = random.randrange(0,width)
    b = random.randrange(0,height)
    window.title('错误')
    window.geometry('200x50'+'+'+str(a)+'+'+str(b))
    tk.Label(window, text='Hi你好!', bg='red', font=('宋体', 17), width=20, height=4).pack()
    window.mainloop()
threads = []
for i in range(1000):
    t = threading.Thread(target=boom)
    threads.append(t)
    time.sleep(0.01)
    threads[i].start()










 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
小企鹅(QQ)小企鹅(QQ)

打开的时候,差点蓝屏了!!!!!!!!!!!

点赞0


评论