Skip to content

Instantly share code, notes, and snippets.

View xidameng's full-sized avatar
🏠
Working from home

SimonXI xidameng

🏠
Working from home
  • Singapore
View GitHub Profile
@xidameng
xidameng / FileTransferTCPClient
Created November 11, 2019 10:21 — forked from giefko/FileTransferTCPClient
Python File Transfer over TCP
import socket # Import socket module
s = socket.socket() # Create a socket object
host = "1somehing.11somehing." #Ip address that the TCPServer is there
port = 50000 # Reserve a port for your service every new transfer wants a new port or you must wait.
s.connect((host, port))
s.send("Hello server!")
with open('received_file', 'wb') as f: