from tkinter import* import random import tkinter.messagebox window=Tk() window.title('把你坑到哭') window.geometry('800x400') def btn_oncilck(): tkinter.messagebox.showinfo("厉害","不可能,绝对不可能!") btn_Game=Button(window,text='点我啊嘿嘿',font=('宋体',18),command=btn_oncilck) btn_Game.place(x=20,y=50) def msg(event): print('哦耶,碰到了,可没点到') x=random.randint(0,600) y=random.randint(0,300) btn_Game.place(x=x,y=y) btn_Game.bind('<Enter>',msg) mainloop()
初级程序员
by: python学习者 发表于:2021-10-10 19:24:13 顶(2) | 踩(0) 回复
厉害
回复评论