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)
# 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:]
TrR = ge[0:1]
ge = ge[1:]
try:
y = int(ge[((int(ge.find(',')+1))):])
x = int(ge[:(int(ge.find(',')))])
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)
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)
else:
mouse.click(Button.left, 1)
print (TrR)
except:
print ("error")
except:
print ("error")
g.close()
g.close()