Our FREE site is mostly funded by the Amazon ads ⇓below⇓.
Support us by clicking ⇑above⇑ next time you plan to buy a product on Amazon.
if __name__ == "__main__":
import socket # Import socket module
sock = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12312
with open("Received_file", "wb") as out_file:
data = sock.recv(1024)
if not data:
out_file.write(data) # Write data to a file
print("Successfully got the file")