clean up removal of tqdm

This commit is contained in:
CactiChameleon9 2020-12-10 08:45:54 +00:00
parent 4904363288
commit b9c4b014c2

View File

@ -37,55 +37,53 @@ filename = os.path.basename(filename)
filesize = int(filesize) filesize = int(filesize)
# start receiving the file from the socket # start receiving the file from the socket
# and writing to the file stream # and writing to the file stream
progress = "_"
#with open(filename, "wb") as f: #with open(filename, "wb") as f:
while True: while True:
for _ in progress: # read 1024 bytes from the socket (receive)
# read 1024 bytes from the socket (receive) bytes_read = client_socket.recv(BUFFER_SIZE)
bytes_read = client_socket.recv(BUFFER_SIZE) if not bytes_read:
if not bytes_read: # nothing is received
# nothing is received # file transmitting is done take another time
# file transmitting is done take another time break
break # write to the file the bytes we just received
# write to the file the bytes we just received
# update the progress bar # update the progress bar
f = open(filename, 'wb') f = open(filename, 'wb')
f.write(bytes_read) f.write(bytes_read)
f.close() f.close()
g = open(filename, 'r') g = open(filename, 'r')
ge = g.read() ge = g.read()
print (ge) 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: except:
y = int(ge[((int(ge.find(',')+1))):]) print ("error")
x = int(ge[:(int(ge.find(',')))])
g.close()
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()