[ACCEPTED]-python socket - how to save stream to file-sockets
Accepted answer
By a simple client socket program?
import socket
HOST = 'yourhost' # The remote host
PORT = 101 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
data = s.recv(1024)
s.close()
with open('yourfile','w') as f:
f.write(data)
Further 1 help here.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.