clean up removal of tqdm

This commit is contained in:
CactiChameleon9
2020-12-10 08:44:59 +00:00
parent 4eb152b8aa
commit 4904363288
7 changed files with 220 additions and 229 deletions

View File

@ -31,22 +31,21 @@ 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
f = open(filename, 'ab')
f.write(bytes_read)
print(bytes_read)
f.close()
# 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
f = open(filename, 'ab')
f.write(bytes_read)
print(bytes_read)
f.close()
# close the client socket
#client_socket.close()