some other version
This commit is contained in:
@@ -46,10 +46,11 @@ class Networking:
|
||||
self.get("/displays" + display + "/write_score/" + str(score))
|
||||
|
||||
def getInputEvent(self):
|
||||
header = ''
|
||||
while chr(2) not in header:
|
||||
header += str(self.input_socket.recv(1))
|
||||
header = bytearray()
|
||||
while b'\x02' not in header:
|
||||
bla = self.input_socket.recv(1)
|
||||
header.append(bla)
|
||||
|
||||
length = int(header[:-1])
|
||||
length = int(str(header[:-1]))
|
||||
|
||||
return self.input_socket.recv(length)
|
||||
|
||||
@@ -43,11 +43,11 @@ def create_menu():
|
||||
# quit = True
|
||||
|
||||
def print_input():
|
||||
print("Starting to print incoming events:")
|
||||
# end_loop_handler = signal.signal(signal.SIGINT, sigint_handler)
|
||||
while(True):
|
||||
print(networking.getInputEvent())
|
||||
# signal.signal(signal.SIGINT, end_loop_handler)
|
||||
quit = False
|
||||
|
||||
def create_lamps_submenu(lamps):
|
||||
menu = CursesMenu("Output", "Lamps")
|
||||
|
||||
Reference in New Issue
Block a user