Python

(50)

中午用 Python telnetlib 写了个水木社区的自动挂机涨积分的脚本

核心代码就这么几行,从 Github 上抄的。。。 使用的是 Python 内置的 telnetlib 这个库。 需要注意的是 expect 里的规则是正则,所以判断登录之后修改密码的逻辑一定要将中括号转义。 ```

Python 计时用装饰器

``` def time_it(method):

Python 中 uuid1 与 uuid4 的区别

## uuid1 是与机器信息相关的一个 uuid,包含了时间信息,以及机器信息. 分布式存储时使用。 ## uuid4 则是一个纯随机数,与机器无关, 相重的几率很小。通常生成用户id用这个。

Python Logging

> One of the differences between a great programmer and a bad programmer is that a great programmer adds logging and to

python 的两种除法

Python 除法运算符 '/' 与 '//' 的区别 ``` >>> 10 / 3 3 >>> 10 // 3 3 >>> 10 / 3.0 3.3333333333333335 >>> 10 // 3.0 3.0

SQLAlchemy

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and

Python Testing

> 是否可自动化测试是评判程序好坏的唯一标准 ## 注意 需要区分 mock 不同对象的方法, 例如: * mock method (被测试类已被实例化) -> MagicMock * mock method argume

urllib2 使用 http 代理

需要验证的问题 - 如何使用代理 - 设置代理之后是否对 urllib2 有全局影响 ## 测试程序 api.py ``` # -*- coding: utf-8 -*- import urllib2

gevent

> We can become blind by seeing each day as a similar one. -- Paolo Coelho ## 教程 [最佳教程](http://sdiehl.github.com/

Python 包管理

## PyPI [PyPI](https://pypi.python.org/pypi) - the Python Package Index ## 参考文档 第一次提交参考了 [How to submit a package