Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
Created September 29, 2012 09:20
Show Gist options
  • Save mike-zhang/3803541 to your computer and use it in GitHub Desktop.
Save mike-zhang/3803541 to your computer and use it in GitHub Desktop.
a simple tcp client(python code)
#! /usr/bin/python
# a simple tcp client
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 12345))
#sock.send('Test\n')
sock.send(raw_input("Please input : "))
print sock.recv(1024)
sock.close()
@Manelmaarfi
Copy link

what does raw_input do ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment