diff --git a/Client/serversend - mirror - mouse.py b/Client/serversend - mirror - mouse.py index cba6898..5654154 100644 --- a/Client/serversend - mirror - mouse.py +++ b/Client/serversend - mirror - mouse.py @@ -37,55 +37,53 @@ filename = os.path.basename(filename) filesize = int(filesize) # start receiving the file from the socket # and writing to the file stream -progress = "_" #with open(filename, "wb") as f: while True: - for _ in progress: - # read 1024 bytes from the socket (receive) - bytes_read = client_socket.recv(BUFFER_SIZE) - if not bytes_read: - # nothing is received - # file transmitting is done take another time - break - # write to the file the bytes we just received + # read 1024 bytes from the socket (receive) + bytes_read = client_socket.recv(BUFFER_SIZE) + if not bytes_read: + # nothing is received + # file transmitting is done take another time + break + # write to the file the bytes we just received - # update the progress bar - f = open(filename, 'wb') - f.write(bytes_read) - f.close() + # update the progress bar + f = open(filename, 'wb') + f.write(bytes_read) + f.close() - g = open(filename, 'r') - ge = g.read() - print (ge) + g = open(filename, 'r') + ge = g.read() + print (ge) + + TrR = ge[0:1] + ge = ge[1:] + + try: + y = int(ge[((int(ge.find(',')+1))):]) + x = int(ge[:(int(ge.find(',')))]) - TrR = ge[0:1] - ge = ge[1:] + + print(x) + print(y) + mouse.position = (x,y) + if (TrR == 'R'): + mouse.click(Button.right, 1) + print (TrR) + + else: + mouse.click(Button.left, 1) + print (TrR) + - try: - y = int(ge[((int(ge.find(',')+1))):]) - x = int(ge[:(int(ge.find(',')))]) - - - print(x) - print(y) - mouse.position = (x,y) - if (TrR == 'R'): - mouse.click(Button.right, 1) - print (TrR) - - else: - mouse.click(Button.left, 1) - print (TrR) - - - except: - print ("error") - - g.close() + except: + print ("error") + + g.close()