提交 aa2bf992 编写于 作者: L libb

add socket01

Change-Id: I7e4b41e08dec2cafab797a83c19cd0001c10a601
上级 e7babb22
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 文件名:client.py
import socket # 导入 socket 模块
s = socket.socket() # 创建 socket 对象
host = "127.0.0.1" # 获取本地主机名
port = 9099 # 设置端口号
s.connect((host, port))
s.send("1111")
print s.recv(1024)
s.close()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册