Rename file_transfer and linear_algebra (#1118)

* Rename file_transfer and linear_algebra

* Rename file_transfer and linear_algebra
This commit is contained in:
Christian Clauss
2019-08-09 21:37:16 +02:00
committed by GitHub
parent c686cc5863
commit 91c3c98d2b
8 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1,23 @@
if __name__ == '__main__':
import socket # Import socket module
sock = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12312
sock.connect((host, port))
sock.send(b'Hello server!')
with open('Received_file', 'wb') as out_file:
print('File opened')
print('Receiving data...')
while True:
data = sock.recv(1024)
print(f"data={data}")
if not data:
break
out_file.write(data) # Write data to a file
print('Successfully got the file')
sock.close()
print('Connection closed')