python性能增强工具shedskin 0.3版发布
http://code.google.com/p/shedskin/ Shed Skin 0.3 - support for 3 new standard library modules (now about 20 in total): - itertools (jeremie roquet) - heapq (jeremie roquet) - csv (converted using shedskin) - 4 new example programs (now 44 in total!): - maximum weighted matching algorithm (joris van rantwijk) - kanoodle: knuth's dancing links (david austin) - bidirectional dijkstra algorithm (from networkx, uses heapq) - barnes-hut force calculation - improved type inference (scalability, bugfixes, major cleanup) - support for 'map', 'filter', 'reduce' and 'next' - support for 'with' statement (jeremie roquet) - support for 'key' argument of 'sorted' (and 'list.sort') - reorganized codebase, distutils setup.py (thomas spura) - optimized list indexing (joris van rantwijk) - optimized addition of 1-length lists and strings - improved forward referencing of variables/functions - avoid GCC warnings after 'shedskin -e' - support for passing keyword arguments to extension modules - optimized list slicing - ignore blocks surrounded by #{ and #} (mike schrick) - add --makefile option (mike schrick) - several cleanups, removing about 100 lines again - large amount of bugfixes
相关文档:
赖勇浩(http://laiyonghao.com)
今天(2009年5月31日) OurPNP.org 搞了个聚会活动,弄了十几二十个人在广州海珠广场的堂会呆了五个小时,创下了我在 K 房呆的最长时间纪录。应他们的邀请,我做了个题为《用 python 快速搭建网游服务器》的小演讲,因为那边的电视竟然不能接电脑,所以讲的时候没有能够参照 PPT 来讲,观 ......
8.8. queue — A synchronized queue class¶
queue -- 一个同步队列类
The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implemen ......
前一段时间试着用这三种语言简单的写了关于文件拷贝的程序,发现c#和python的api惊人的相似,对于文件的操作这两种语言非常的方便。都没有加异常的处理
C#源代码:
public static void CopyFile(string source, string destination)
& ......
这是一个我们在处理中文时, 经常遇到的问题.
python里面基本上要考虑三种编码格式
1 源文件编码
在文件头部使用coding声明。告诉python解释器该代码文件所使用的字符集。
#/usr/bin/python
#coding: utf8
2 内部编码
代码文件中的字符串,经过decode以后,被转换为统一的unicode格式的内部数据,类似于u'*'。unic ......
谢了一个自动下载指定人的博客的脚本
这个脚本是用来下载csdn博客的
同样的方法可以下载一般其他网站的博客,如sina
有时页面访问会被拒绝,重新运行即可
这种程序是在分析了指定网站,我在这儿是csdn,之后编写出的
会牵涉到网页的编码问题,有时程序运行会因此终止
我自己的博客已经下载忘了
只是下载网页
使用网 ......