摘要: @property可以将python定义的函数“当做”属性访问,从而提供更加友好访问方式,但是有时候setter/deleter也是需要的。1》只有@property表示只读。2》同时有@property和@x.setter表示可读可写。 3》同时有@property和@x.setter和@x.de 阅读全文
posted @ 2017-07-12 22:37 howhy 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 我们在使用 Decorator 的过程中,难免会损失一些原本的功能信息。直接拿 stackoverflow 里面的栗子 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 def logged(func): def with_logging(*args, **k 阅读全文
posted @ 2017-07-12 22:16 howhy 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1.python-qrcode是个用来生成二维码图片的第三方模块,依赖于 PIL 模块和 qrcode 库。 首先,我们要安装三个模块,qrcode,image,PIL。 pip install qrcode pip install image PIL:Python Imaging Library, 阅读全文
posted @ 2017-07-12 16:14 howhy 阅读(262) 评论(0) 推荐(0) 编辑