python
winlerman
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
为Python添加默认模块搜索路径
为Python添加默认模块搜索路径 转载http://www.douban.com/note/334738164/ 方法一:函数添加 1 import sys 2 查看sys.path 3 添加sys.path.append("c:\\") 方法二:修改环境变量 w用户可以修改系统环境变量PYTHONPATH 方法三:增加.pth文件,推荐! 在site-pa转载 2015-05-21 10:02:08 · 465 阅读 · 0 评论 -
python字典全并
Python 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a={1:2} >>> b={2:3} >>> id(a) 33107280 >>> id(b)原创 2015-05-22 12:52:31 · 340 阅读 · 0 评论 -
python装饰器
http://www.cnblogs.com/rhcad/archive/2011/12/21/2295507.html 这是在Python学习小组上介绍的内容,现学现卖、多练习是好的学习方式。 第一步:最简单的函数,准备附加额外功能 1 2 3 4 5 6 7 8 # -转载 2015-07-09 15:06:28 · 340 阅读 · 0 评论 -
具有继承关系的类的__init__方法的默认调用
1. 当子类中定义了__init__方法,则如不在子类中明确的调用父类的__init __方法, 父类的__init__方法将不会被调用 。 2. 当子类中没有定义__init__方法, 则父类中的__init__方法将会被默认调用。原创 2015-08-25 11:51:28 · 757 阅读 · 0 评论 -
filter map reduce
http://www.cnblogs.com/longdouhzt/archive/2012/05/19/2508844.html转载 2015-08-13 11:39:46 · 412 阅读 · 0 评论 -
function, method, unbound_method, bound_method
class A(object): def uf(): pass def inf(self): pass @classmethod def cf(cls): pass @staticmethod def sf(): pass def ccf(cls): print ccf prin原创 2015-08-13 15:57:12 · 428 阅读 · 0 评论 -
python dir __dict__
勘误:本文中的staticmethod 应为classmethod。 当访问或查看对象的属性的时候会涉及到dir()及__dict__. 当一个对象访问其某个属性的时候,其是如何找到这个属性的呢?是从什么地方按什么顺序去查找这个属性的呢? 首先看一个dir及__dict__的帮助。 1. help(dir) dir(...) dir([object]) -> list o原创 2015-08-20 11:27:04 · 1285 阅读 · 0 评论 -
ubuntu多版本python无法导入sqlite3的解决方法
http://stackoverflow.com/questions/1210664/no-module-named-sqlite3 无法导入的原因1.多版本python的依赖关系不同 2. python 安装./configure默认没有考虑sqlite3。 解决方法: 1. 安装 sqlite-devel or libsqlite3-dev 2. ./configure --ena翻译 2015-11-19 01:27:33 · 1299 阅读 · 0 评论
分享