- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
Latest commit
37 lines (28 loc) · 792 Bytes
/
Copy pathclient.py
File metadata and controls
37 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
fromTeamimportTeam
importwarnings, random
fromVocabListimportVocabList
fromGameimportGame
importrandom, os, socket, pickle
importpygame
importtkinter
importtkinter.filedialog
importmatplotlib.pyplotasplt
importpandasaspd
root=tkinter.Tk()
root.withdraw()
pygame.init()
s=socket.socket() # Create a socket object
host=socket.gethostname() # Get local machine name
port=12345# Reserve a port for your service.
s.connect((host, port))
game=Game(spymaster=True)
whileTrue:
board=s.recv(700)
board=pickle.loads(board)
ifnotboard:
exit()
game.set_simple_board(board)
game.draw_board()
foreventinpygame.event.get():
ifevent.type==pygame.QUIT: # Usually wise to be able to close your program.
raiseSystemExit