码迷,mamicode.com
首页 > Windows程序 > 详细

apihelper.py

时间:2014-08-15 01:16:46      阅读:436      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   for   ar   cti   div   

 1 def info(object, spacing=10, collapse=1):
 2     """Print methods and doc strings.
 3     
 4     Takes module, class, list, dictionary, or string."""
 5     methodList = [method for method in dir(object) if callable(getattr(object, method))]
 6     processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s)
 7     print "\n".join(["%s %s" %
 8                       (method.ljust(spacing),
 9                        processFunc(str(getattr(object, method).__doc__)))
10                      for method in methodList])

 

apihelper.py,布布扣,bubuko.com

apihelper.py

标签:style   blog   color   io   for   ar   cti   div   

原文地址:http://www.cnblogs.com/zhangxiaodao/p/3913683.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!