生成python模块的函数列表文件用于vim自动补全

#!/usr/bin/env python
#coding:utf-8

from wx import *
attrs = dir(wx.App) + dir(wx.Frame) + dir(wx.Panel) + dir(wx.StaticText) + dir(wx.TextCtrl) + dir(wx)
attrs.sort()
attrs_unique = {}.fromkeys(attrs).keys()
lines = "\n".join(attrs_unique)
h = open(r'd:\python.txt','w+')
h.write(lines)
h.close()

 

执行这个脚本 在 d 盘根目录下生成一个  python.txt 文件

posted @ 2011-11-19 15:23  秋丰  阅读(244)  评论(0)    收藏  举报