话说Pywinauto真是好用阿,不过有些脚本想给同事用他们要安装Python就有点麻烦了,用Py2exe编译出的程序运行时总提示有错误。今天花了点时间,原来Py2exe的脚本里有很多选项可以用。先写这一点吧。

from distutils.core import setup
import py2exe

setup(console=[’setup_vista32.py’],
options={
                 "py2exe":{
                 "packages":
                                  ["pywinauto",
                                  "pywinauto.findwindows",
                                  "pywinauto.controls",
                                  "pywinauto.tests"]
                                  }
                }

以后再慢慢优化把垃圾去出去。