发布时间:2019-09-09 08:46:32编辑:auto阅读(2207)
环境:kali 一个server.py和client.py
sever.py# -*- coding: utf-8 -*
#Server.py
import socket
host = socket.gethostname()
port = 12345
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(1)
sock, addr = s.accept()
print "Linked"
info = sock.recv(1024)
while info != "exit":
print "From Others : "+info
send_mes = raw_input("")
sock.send(send_mes)
if send_mes == "exit":
break
info = sock.recv(1024)
sock.close()
s.close()
上一篇: Python发送Http请求时,中文乱码
下一篇: python获取sessionid
51555
51124
41651
38407
32896
29871
28588
23544
23478
21823
1969°
2675°
2234°
2167°
2612°
2189°
2927°
4856°
4691°
3335°