socket.gaierror: [Errno -2] Name or service not known
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Guys i'm a newbie to the socket programming Following program is a client program which request a file from the server,But i'm getting the error as show below.. My input is GET index.html and the code is Can anyone solve this error...? #!/usr/bin/env python import httplib import sys http_server = sys.argv[0] conn = httplib.HTTPConnection(http_server) while 1: cmd = raw_input('input command (ex. GET index.html): ') cmd = cmd.split() if cmd[0] == 'exit': break conn.request(cmd[0],cmd[1]) rsp = conn.getresponse() print(rsp.status, rsp.reason)