import socket

s= socket.socket()

host = input(str("Please enter the host address of the sender: "))

port = 8080
s.connect((host, port))
print("Connected...")

filename = input(str("Please enter the name of the incoming file: "))

file = open(filename, 'wb')

file_data = s.receive(1024)

file.write(file_data)

file.close()

print("File has been received successfully!")