用户:
尧之帝查看:0 回复:1 评论:0 创建时间:2023-03-12T11:17:33
【作品展示】

【作品介绍】
大家周插拔
【作品源代码】
from tkinter import *
from PIL import Image
from PIL import ImageTk
import random
ck = Tk()
ck.title('火眼金睛')
l1 = ['士', '睛', '牛', '茶', '珅', '人', '千',
'犬', '垚', '姬', '已', '袓', '市', '币', '芙', '汆', '采']
l2 = ['土', '晴', '午', '荼', '坤', '入', '干',
'太', '壵', '姫', '己', '祖', '巿', '帀', '芺', '氽', '釆']
k = 0
def fzan():
x = random.randint(0,5)
y = random.randint(0,7)
for i in range(10):
for j in range(15):
if i == x and j == y:
b = Button(ck, text=l1[k],font=("黑体", 30),
fg = 'white',background = 'black',command = xia)
else:
b = Button(ck, text=l2[k],font=("黑体", 30),
fg = 'white',background = 'black')
b.grid(row = i, column = j)
def xia():
global k
k+=1
if k == len(l1):
exit()
else:
fzan()
fzan()
ck.mainloop()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn