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
z00222334
V2EX  ›  Python

看到python的客户端里面有一段话 不太明白作用是什么

  •  
  •   z00222334 · 2013-03-17 23:59:38 +08:00 · 3280 次点击
    这是一个创建于 4071 天前的主题,其中的信息可能已经有所发展或是发生改变。
    while 1:
    buf=s.recv(2048)
    if not len(buf):
    break
    sys.stdout.write(buf)
    不太明白作用是什么
    4 条回复    1970-01-01 08:00:00 +08:00
    htedsv
        2
    htedsv  
       2013-03-18 07:18:31 +08:00 via iPad   ❤️ 1
    反复从s接收最大长度序列放到缓存中,然后输出,直到接受完毕
    htedsv
        3
    htedsv  
       2013-03-18 07:20:37 +08:00 via iPad
    补充一下,s是字节流,不能直接输出
    z00222334
        4
    z00222334  
    OP
       2013-03-18 23:01:06 +08:00
    入门小白= =,稍微理解点了多谢楼上回复~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3812 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:33 · PVG 12:33 · LAX 21:33 · JFK 00:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.