文章会有【原创】或者【转载】标示,部分来自Google Baidu的学习结果 {Java/PHP/Python/Ruby/Go}

Python中socket的运用(构建客户端)  


#!/usr/bin/env python
#coding=UTF-8
#Python Socket client端的构建
#Author www.PHPdesigner.org Time:2010-07-23 13:35
#Application-Language:Python2.x
import socket

client = socket.socket()
server = socket.gethostname()
port = 1987
client.connect((server,port))

print client.recv(1024)

client.close()