首页 > Windows开发 > 详细

apihelper.py

时间:2014-08-15 01:16:46      阅读:493      评论:0      收藏:0      [点我收藏+]
 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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!