猫史档案馆


【Python作品分享】Tkinter【作品秀】

用户:追风少追风少查看:0 回复:0 评论:0 创建时间:2022-08-15T20:13:17


【作品展示】

center_image

 

【作品介绍】

Tkinter比easygui好多了,比easygui的功能更多,建议大家开始学Tkinter

 

【作品源代码】

from tkinter import *
import sys
import time
tk = Tk()
tk.geometry('200x60')
tk.title('有风险')
label = Label(tk, text='此应用有风险,是否运行?', bg='red')
label.grid(row=2)
a = False


def yes():
    a = True
    root = Tk()
    root.title("炸显卡时间到!")
    message = Message(root, text='你已经运行病毒,但我们并不会让你的电脑瘫痪,喵机,删除文件等等操作,就是有点卡。放心,你的电脑会没事的。', width=100)
    message.pack()
    time.sleep(0)
    循环到怀疑人生 = True
    while 循环到怀疑人生:
        warning = Toplevel()
        wei = Label(warning, text="电脑再见")
        wei.pack()
        time.sleep(0.5)


buttonyes = Button(tk, text='是', command=yes)
buttonyes.grid(row=4, column=0, padx=10, pady=5, stick=W)
buttonno = Button(tk, text='否', command=sys.exit)
buttonno.grid(row=4, column=1, padx=10, pady=5, stick=E)

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页