用户:Bamshine竹潇查看:0 回复:1 评论:0 创建时间:2022-07-23T14:43:44
【作品展示】

【作品介绍】
import tkinter as tkimport time, easygui
import random
import threading
import time
import PySimpleGUI as sg
def dow():
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='开不开心!',bg='Red', font=('楷体', 17),width=15, height=2).pack() # 固定窗口位置
window.mainlo
【作品源代码】
import tkinter as tk
import time, easygui
import random
import threading
import time
import PySimpleGUI as sg
def dow():
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='开不开心!',bg='Red', font=('楷体', 17),width=15, height=2).pack() # 固定窗口位置
window.mainloop()
threads = []
easygui.msgbox("友情提示不要点击继续哦!", title="提示", ok_button="知道啦")
sg.theme('BluePurple')
layout = [ #
[sg.Text('你真的要继续么')],
[sg.Button('是的是的')], [sg.Button('不是')]
]
window = sg.Window('真的确定么', layout)
event, value = window.read()
window.close()
if event == '是的是的':
for i in range(200):
t = threading.Thread(target=dow)
threads.append(t)
time.sleep(0)
threads[i].start()
else:
sg.popup('恭喜你做出一个明确的决定,奖励你一个爱心')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn