from socket import * client=socket(AF_INET,SOCK_STREAM) client.connect(('127.2.2.2',6688)) while True: cmd=input('>>:').strip() if not cmd:continue client.send(cmd.encode('utf-8')) data=client.recv(1024) print(data.decode('gbk')) client.close()