import socket HOST = 'localhost' # The remote host PORT = 8000 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) indata = open("../images/teste.txt", "r"); fdata = indata.read(); indata.close(); #open("../images/img02.jpeg", "wb").write(fdata); # Grava uma imagem. s.send(fdata) #data = s.recv(1024) #s.close() #print 'Received', repr(data)