推荐学习书目
› 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
Gem
V2EX  ›  Python

print "hello world" 多好

  •  
  •   Gem · Jan 4, 2017 · 3799 views
    This topic created in 3559 days ago, the information mentioned may be changed or developed.
    python3 其他改进还好,就是这个 print ,设计成函数 print("hello world"),感觉不简洁了。
    10 replies  •  2017-01-05 16:54:35 +08:00
    fatestigma
        1
    fatestigma  
       Jan 4, 2017
    恩。一开始我也这么觉得。但是习惯了也还好。
    你可以看看几个讨论:
    https://www.reddit.com/r/Python/comments/45vok2/why_did_python_3_change_the_print_syntax/
    https://news.ycombinator.com/item?id=10822804
    官方基本在 3.0 的介绍里都会把「 Print Is A Function 」放第一个。
    guyskk
        2
    guyskk  
       Jan 4, 2017 via Android
    设计成函数方便传参数控制输出格式,也可以 from pprint import ppring as print 这样,总结起来就是增加灵活性减少暗坑
    leavic
        3
    leavic  
       Jan 4, 2017
    等你要把 print 作为回调函数的时候你就知道这个改进有多好了
    msg7086
        4
    msg7086  
       Jan 5, 2017
    你要简洁为什么还要用 Python ?
    Gem
        5
    Gem  
    OP
       Jan 5, 2017
    @msg7086 OK, let's ruby... and on rails!
    nicegoing
        6
    nicegoing  
       Jan 5, 2017
    IDE 不帮你干好了吗?自动补全。
    littleshy
        7
    littleshy  
       Jan 5, 2017
    感觉还是函数调用不需要括号爽。
    zjyjer
        8
    zjyjer  
       Jan 5, 2017
    @littleshy Haskell 大法好
    littleshy
        9
    littleshy  
       Jan 5, 2017
    @zjyjer Ruby, Elixir, F# 都不用呀。
    ferstar
        10
    ferstar  
       Jan 5, 2017
    习惯就好, 反正为了 Python3 可以无视 u"哈哈"这一条打死我都要上船
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2487 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:34 · PVG 11:34 · LAX 20:34 · JFK 23:34
    ♥ Do have faith in what you're doing.