Skip to content

Instantly share code, notes, and snippets.

@Fabryz
Created July 22, 2008 00:14
Show Gist options
  • Save Fabryz/502 to your computer and use it in GitHub Desktop.
Save Fabryz/502 to your computer and use it in GitHub Desktop.
from socket import *
print "*** Client - Welcomato nella chat a turni ***\n"
IP = 'localhost'
PORT = 4000
ADS = (IP, PORT)
tcpsoc = socket(AF_INET, SOCK_STREAM)
tcpsoc.connect(ADS)
NICK = raw_input("Inserire il nick: ")
NICK +=": "
while 1:
data = raw_input(NICK)
if not data : break
tcpsoc.send(data)
data = tcpsoc.recv(1024)
if not data: break
print data
tcpsoc.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment