python advance program - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
hupantingxue

python advance program

  •  
  •   hupantingxue Mar 19, 2014 4918 views
    This topic created in 4425 days ago, the information mentioned may be changed or developed.
    汇总了一些python高阶编程的范例,比如list comprehension, generator, Decorators, map, reduce, Higher-order function...大家一起学习学习:
    https://github.com/hupantingxue/advancedpython
    11 replies    2014-07-16 12:17:24 +08:00
    Froshal
        1
    Froshal  
       Mar 19, 2014
    谢谢分享
    a2z
        2
    a2z  
       Mar 19, 2014   1
    感谢分享
    raquelken
        3
    raquelken  
       Mar 19, 2014
    分享是好事,但是希望能写正确。。。
    cocorosiekz
        4
    cocorosiekz  
       Mar 19, 2014   1
    python官网有how to系列,其中有函数式编程部分,地址http://docs.python.org/2/howto/functional.html
    hupantingxue
        5
    hupantingxue  
    OP
       Mar 19, 2014
    @raquelken 有问题可以直接给我提issue,谢谢!
    ljcarsenal
        6
    ljcarsenal  
       Mar 19, 2014 via Android
    马克
    yakczh
        7
    yakczh  
       Mar 19, 2014
    问个低阶的问题
    怎么用format格式化tuple的子项
    比如
    tu=('Server', 'Apache/2.2.4 ')

    print(" {0}:{1} ".format(tu))
    想输出 Server : Apache/2.2.4
    但是提示tuple index out of range
    polythene
        8
    polythene  
       Mar 19, 2014
    @yakczh try: print(" {0}:{1} ".format(*tu))
    yakczh
        9
    yakczh  
       Mar 19, 2014
    @polythene 文档中没看到这种用法,能解释下吗?
    lsj5031
        10
    lsj5031  
       Mar 19, 2014
    @yakczh
    unpack the tuple/sequence/collection into positional arguments.
    因为format要跟的参数不是这个tuple,而是你那两个string。
    hupantingxue
        11
    hupantingxue  
    OP
       Jul 16, 2014
    更新了一下
    About     Help     Advertise     Blog     API     FAQ     Solana     2577 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VRSION: 3.9.8.5 50ms UTC 12:27 PVG 20:27 LAX 05:27 JFK 08:27
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86