推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Any9aby
V2EX  ›  Python

python 新手求助 关于 socket 的错误

  •  
  •   Any9aby · Feb 13, 2015 · 3366 views
    This topic created in 4245 days ago, the information mentioned may be changed or developed.

    import socket
    s = socket.socket()
    s.connect(('127.0.0.1', 80))
    s.send('Primal Security \n')

    执行以上代码的时候会报错
    错误内容:Traceback (most recent call last):
    File "C:\Users\Administrator\Desktop\新建文本文档.txt", line 3, in <module>
    s.connect(('127.0.0.1', 80))
    File "D:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
    socket.error: [Errno 10061]

    nomaka
        1
    nomaka  
       Feb 13, 2015
    本机80端口没服务起来 windows下是10061错误 linux下多数是111错误
    Any9aby
        2
    Any9aby  
    OP
       Feb 13, 2015
    - -80端口是开启的可以确定。用telnet 127.0.0.1 80 是开放的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1128 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:26 · PVG 07:26 · LAX 16:26 · JFK 19:26
    ♥ Do have faith in what you're doing.