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

python大家用的版本是什么,why?

  •  
  •   mlzboy · 2011-12-07 17:57:01 +08:00 · 5374 次点击
    这是一个创建于 4733 天前的主题,其中的信息可能已经有所发展或是发生改变。
    RT
    19 条回复    1970-01-01 08:00:00 +08:00
    clino
        1
    clino  
       2011-12-07 18:05:03 +08:00
    基本上是 2.6.x,因为 ubuntu 系统预装了,而且比较主流
    有台windows服务器因为依赖的模块只有 2.5.x 的,只好装 2.5 的了
    xiaket
        2
    xiaket  
       2011-12-07 18:32:12 +08:00
    2.7, 开始往3靠
    9hills
        3
    9hills  
       2011-12-07 18:56:24 +08:00
    激进的arch。。不过好在有virtualenv
    [cynic@9hills:~]
    % python --version
    Python 3.2.2
    [cynic@9hills:~]
    % python2 --version
    Python 2.7.2
    tiantian20007
        4
    tiantian20007  
       2011-12-07 19:54:51 +08:00
    可以试试pypy.org
    mailing list原文

    Summary: Pypy 1.7 is almost twice as fast as cpython 2.7 on the
    tornado HTTPServer benchmark, and three times as fast on the
    template-rendering benchmark. Pypy used about three times as much
    memory in both cases, but usage was stable over time (i.e. it's not
    "leaking" like pypy 1.6 did).

    Details: Tested on an "m1.large" EC2 instance running ubuntu 10.04
    and the 64-bit binary releases of pypy (and cpython 2.7 from
    https://launchpad.net/~fkrull/+archive/deadsnakes). Large instances
    have two cores so the ab client wasn't competing for cpu cycles with
    the python process.

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time python2.6
    demos/benchmark/benchmark.py --quiet --num_runs=5|grep "Requests per
    second"
    Requests per second: 2010.39 [#/sec] (mean)
    Requests per second: 2010.70 [#/sec] (mean)
    Requests per second: 2000.56 [#/sec] (mean)
    Requests per second: 2007.37 [#/sec] (mean)
    Requests per second: 1983.27 [#/sec] (mean)
    34.19user 7.29system 0:37.75elapsed 109%CPU (0avgtext+0avgdata
    59040maxresident)k
    0inputs+0outputs (0major+22404minor)pagefaults 0swaps

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time python2.7
    demos/benchmark/benchmark.py --quiet --num_runs=5|grep "Requests per
    second"
    Requests per second: 2127.01 [#/sec] (mean)
    Requests per second: 2122.64 [#/sec] (mean)
    Requests per second: 2219.56 [#/sec] (mean)
    Requests per second: 2209.65 [#/sec] (mean)
    Requests per second: 2204.07 [#/sec] (mean)
    30.62user 6.76system 0:34.83elapsed 107%CPU (0avgtext+0avgdata
    60480maxresident)k
    0inputs+8outputs (1major+20898minor)pagefaults 0swaps

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time ~/pypy-1.6/bin/pypy
    demos/benchmark/benchmark.py --quiet --num_runs=5|grep "Requests per
    second"
    Requests per second: 2436.49 [#/sec] (mean)
    Requests per second: 3289.71 [#/sec] (mean)
    Requests per second: 3469.36 [#/sec] (mean)
    Requests per second: 3453.05 [#/sec] (mean)
    Requests per second: 3373.15 [#/sec] (mean)
    22.06user 6.76system 0:25.76elapsed 111%CPU (0avgtext+0avgdata
    328208maxresident)k
    0inputs+3328outputs (0major+89216minor)pagefaults 0swaps

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time ~/pypy-1.7/bin/pypy
    demos/benchmark/benchmark.py --quiet --num_runs=5|grep "Requests per
    second"
    Requests per second: 2673.48 [#/sec] (mean)
    Requests per second: 4410.94 [#/sec] (mean)
    Requests per second: 4155.42 [#/sec] (mean)
    Requests per second: 4164.85 [#/sec] (mean)
    Requests per second: 4626.81 [#/sec] (mean)
    17.15user 6.95system 0:21.08elapsed 114%CPU (0avgtext+0avgdata
    186576maxresident)k
    0inputs+2680outputs (0major+59250minor)pagefaults 0swaps

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time python2.7
    demos/benchmark/template_benchmark.py --num=1000
    38.003 ms per iteration
    37.56user 0.54system 0:38.14elapsed 99%CPU (0avgtext+0avgdata 46672maxresident)k
    0inputs+136outputs (0major+119479minor)pagefaults 0swaps

    ubuntu@ip-10-114-147-85:~/tornado$ /usr/bin/time ~/pypy-1.7/bin/pypy
    demos/benchmark/template_benchmark.py --num=1000
    12.899 ms per iteration
    13.08user 0.03system 0:13.11elapsed 99%CPU (0avgtext+0avgdata
    153296maxresident)k
    0inputs+144outputs (0major+14267minor)pagefaults 0swaps
    likuku
        5
    likuku  
       2011-12-07 20:12:50 +08:00
    gentoo 2.7&3,macosx 2.5
    freetstar
        6
    freetstar  
       2011-12-07 20:33:30 +08:00
    archlinux py2.7
    mlzboy
        7
    mlzboy  
    OP
       2011-12-08 11:11:56 +08:00
    @9hills 这个连python的版本也能管理?我一直以为只能管理包的版本
    mathgl
        8
    mathgl  
       2011-12-08 20:22:36 +08:00
    py 2.6.6...
    9hills
        9
    9hills  
       2011-12-09 10:58:05 +08:00
    @mlzboy virtualenv -p /usr/bin/python2.6
    -p 是 --python 故也可以用 --python=python2.5 这种格式

    p.s. virtualenv + pip 乃是王道~~ 远程部署再加上 Fabric 就完美了
    epic2005
        10
    epic2005  
       2011-12-20 14:54:35 +08:00
    2.7
    empilot
        11
    empilot  
       2011-12-20 14:58:58 +08:00
    2.7
    CMGS
        12
    CMGS  
       2011-12-20 15:47:27 +08:00
    2.7
    zhouyang
        13
    zhouyang  
       2011-12-20 15:48:30 +08:00
    2.7 on lion
    windhunter
        14
    windhunter  
       2011-12-20 15:52:00 +08:00
    2.7 on ubuntu & win7
    是否最新并不是最重要的,stable第一。
    oldgun
        15
    oldgun  
       2011-12-20 23:19:28 +08:00
    从2.5出来用到现在没换过
    不需要换
    kojp
        16
    kojp  
       2011-12-20 23:40:45 +08:00
    WIN 下,2.7 & 2.6 貌似RHEL上自带的是2.4
    alexzhan
        17
    alexzhan  
       2011-12-21 00:04:31 +08:00
    2.7 马上转到3
    fanzeyi
        18
    fanzeyi  
       2011-12-21 00:38:31 +08:00
    2.7
    reus
        19
    reus  
       2011-12-21 01:13:55 +08:00 via Android
    2.7
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   984 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 20:23 · PVG 04:23 · LAX 12:23 · JFK 15:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.