Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5705091
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: Python/Ruby

2006-07-04 18:45:59

python的列表过滤


    methodList = [method for method in dir(object) if callable(getattr(object, method))]

如果了解shell的话,这个将很好理解:

for method in dir(object)
do
if [ callable(getattr(object, method)) ];then
print $method
fi
done

阅读(1694) | 评论(0) | 转发(0) |
0

上一篇:list的深入学习

下一篇:python中的and和or

给主人留下些什么吧!~~