python九宫格输入法_用python解开九宫格子,Python,实现,解锁

rt = Tk()

rt.title('解锁')

rt.geometry('300x300+200+100')

lb = Label(rt, text='绘制圆', width=30, height=2)

lb.place(x=50, y=10)

global s1

global s2

global c1

c1 = 0

def xsq(a, b, c):

global s1

s1 = a

global s2

s2 = b

global c1

c1 = c1 + c

if c1 == 35:

rt.destroy()

def cov1():

s1 = 35

s2 = 35

c = 1

xsq(s1, s2, c)

def cov2():

s3 = 150

s4 = 35

ln2 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 2

xsq(s3, s4, c)

def cov3():

s3 = 260

s4 = 35

ln3 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 3

xsq(s3, s4, c)

def cov4():

s3 = 35

s4 = 135

ln4 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 4

xsq(s3, s4, c)

def cov5():

s3 = 150

s4 = 135

ln5 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 5

xsq(s3, s4, c)

def cov6():

s3 = 260

s4 = 135

ln6 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 6

xsq(s3, s4, c)

def cov7():

s3 = 35

s4 = 235

ln7 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 7

xsq(s3, s4, c)

def cov8():

s3 = 150

s4 = 235

ln8 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 8

xsq(s3, s4, c)

def cov9():

s3 = 260

s4 = 235

ln9 = cv.create_line(s1, s2, s3, s4, fill='blue', arrowshape=(20, 20, 10), width=5)

c = 9

xsq(s3, s4, c)

cv = Canvas(rt, bg='#cccccc', width=500, height=500)

button1 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov1)

button1.place(x=25, y=25)

button2 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov2)

button2.place(x=140, y=25)

button3 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov3)

button3.place(x=255, y=25)

button4 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov4)

button4.place(x=25, y=125)

button5 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov5)

button5.place(x=140, y=125)

button6 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov6)

button6.place(x=255, y=125)

button7 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov7)

button7.place(x=25, y=225)

button8 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov8)

button8.place(x=140, y=225)

button9 = tkinter.Button(rt, text='', bg='red', width=2, height=1, command=cov9)

button9.place(x=255, y=225)

ov1 = cv.create_oval((10, 10, 60, 60), fill='red', width=5, outline='yellow', dash=(5, 2))

ov2 = cv.create_oval((125, 10, 175, 60), fill='red', width=5, outline='yellow', dash=(5, 2))

ov3 = cv.create_oval((240, 10, 290, 60), fill='red', width=5, outline='yellow', dash=(5, 2))

ov4 = cv.create_oval((125, 110, 175, 160), fill='red', width=5, outline='yellow', dash=(5, 2))

ov5 = cv.create_oval((10, 110, 60, 160), fill='red', width=5, outline='yellow', dash=(5, 2))

ov6 = cv.create_oval((240, 110, 290, 160), fill='red', width=5, outline='yellow', dash=(5, 2))

ov7 = cv.create_oval((125, 210, 175, 260), fill='red', width=5, outline='yellow', dash=(5, 2))

ov8 = cv.create_oval((10, 210, 60, 260), fill='red', width=5, outline='yellow', dash=(5, 2))

ov9 = cv.create_oval((240, 210, 290, 260), fill='red', width=5, outline='yellow', dash=(5, 2))

def ass3():

rt.destroy()

bt10= Button(rt, text='返回上一级', width=45, height=1, command=ass3)

bt10.place(x=0, y=270)

cv.place(x=0, y=0)

rt.mainloop()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值