汇总了一些python高阶编程的范例,比如list comprehension, generator, Decorators, map, reduce, Higher-order function...大家一起学习学习:
https://github.com/hupantingxue/advancedpython
https://github.com/hupantingxue/advancedpython
|
FroshalMar 19, 2014
1
谢谢分享
|
|
2
感谢分享
|
|
raquelkenMar 19, 2014
3
分享是好事,但是希望能写正确。。。
|
|
4
python官网有how to系列,其中有函数式编程部分,地址http://docs.python.org/2/howto/functional.html
|
|
5
@raquelken 有问题可以直接给我提issue,谢谢!
|
|
ljcarsenalMar 19, 2014 via Android
6
马克
|
|
yakczhMar 19, 2014
7
问个低阶的问题
怎么用format格式化tuple的子项 比如 tu=('Server', 'Apache/2.2.4 ') print(" {0}:{1} ".format(tu)) 想输出 Server : Apache/2.2.4 但是提示tuple index out of range |
|
lsj5031Mar 19, 2014
10
@yakczh
unpack the tuple/sequence/collection into positional arguments. 因为format要跟的参数不是这个tuple,而是你那两个string。 |
|
11
更新了一下
|