Fork me on GitHub
# import socket
# phone=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# phone.connect(('127.1.1.1',8888))
# phone.send('hello'.encode('utf-8'))
# data=phone.recv(1024)
# print(data)
# phone.close()
'''
b'HELLO'
'''
# import socket
# phone=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# phone.connect(('127.1.1.1',8888))
# while True:
# msg=input('>>:')
# phone.send(msg.encode('utf-8'))
# data=phone.recv(1024)
# print(data)
# phone.close()
''''''
# import socket
# phone=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# phone.connect(('127.1.1.1',8888))
# while True:
# msg=input('>>:').strip() # 去掉空格
# if not msg:continue # 有的系统发空不会回复
# phone.send(msg.encode('utf-8'))
# print('has send')
# data=phone.recv(1024)
# print('has recv')
# print(data)
# phone.close()
posted on 2019-12-31 16:38  OBOS  阅读(191)  评论(0编辑  收藏  举报