运行mincem时出错

2024-06-08 18:04:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我在运行mincemeat时出错。代码在中运行正常十月.py. 我并不是把代码放在课程作业上,而是更喜欢肉馅。错误如下:

C:\Python27>python mincemeat.py -p changeme localhost

C:\Python27>python mincemeat.py -v changeme localhost
Traceback (most recent call last):
  File "mincemeat.py", line 376, in <module>
    run_client()
  File "mincemeat.py", line 372, in run_client
    client.conn(args[0], options.port)
  File "mincemeat.py", line 149, in conn
    self.connect((server, port))
  File "C:\Python27\lib\asyncore.py", line 347, in connect
    err = self.socket.connect_ex(address)
  File "C:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.gaierror: [Errno 11001] getaddrinfo failed

C:\Python27>ping localhost

Pinging anand [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Tags: 代码infrompyselfclientlocalhosttime