MCPcopy Index your code
hub / github.com/ndleah/python-mini-project / show_symbol

Function show_symbol

Matchmaker/Matchmaker.py:5–23  ·  view source on GitHub ↗
(x,y)

Source from the content-addressed store, hash-verified

3from tkinter import Tk, Button, DISABLED
4
5def show_symbol(x,y):
6 global first
7 global previousx, previousy
8 buttons[x,y]['text'] = button_symbols[x,y]
9 buttons[x,y].update_idletasks()
10
11 if first:
12 previousx = x
13 previousy = y
14 first = False
15 elif previousx != x or previousy !=y:
16 if buttons[previousx, previousy]['text'] != buttons[x,y]['text']:
17 time.sleep(0.5)
18 buttons[previousx,previousy]['text']= ' '
19 buttons[x,y]['text'] = ' '
20 else:
21 buttons[previousx, previousy]['command'] = DISABLED
22 buttons[x,y]['command'] = DISABLED
23 first = True
24
25win = Tk()
26win.title('Matchmaker')

Callers 1

Matchmaker.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected