clean up removal of tqdm
This commit is contained in:
parent
4904363288
commit
b9c4b014c2
@ -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]
|
TrR = ge[0:1]
|
||||||
ge = ge[1:]
|
ge = ge[1:]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
y = int(ge[((int(ge.find(',')+1))):])
|
y = int(ge[((int(ge.find(',')+1))):])
|
||||||
x = int(ge[:(int(ge.find(',')))])
|
x = int(ge[:(int(ge.find(',')))])
|
||||||
|
|
||||||
|
|
||||||
print(x)
|
print(x)
|
||||||
print(y)
|
print(y)
|
||||||
mouse.position = (x,y)
|
mouse.position = (x,y)
|
||||||
if (TrR == 'R'):
|
if (TrR == 'R'):
|
||||||
mouse.click(Button.right, 1)
|
mouse.click(Button.right, 1)
|
||||||
print (TrR)
|
print (TrR)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
mouse.click(Button.left, 1)
|
mouse.click(Button.left, 1)
|
||||||
print (TrR)
|
print (TrR)
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print ("error")
|
print ("error")
|
||||||
|
|
||||||
g.close()
|
g.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user