V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2015-02-13 12:51:05 +08:00 · 2703 次点击
    这是一个创建于 3383 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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  
       2015-02-13 13:01:25 +08:00
    本机80端口没服务起来 windows下是10061错误 linux下多数是111错误
    Any9aby
        2
    Any9aby  
    OP
       2015-02-13 14:44:04 +08:00
    - -80端口是开启的可以确定。用telnet 127.0.0.1 80 是开放的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2361 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 09:03 · PVG 17:03 · LAX 02:03 · JFK 05:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.