【发布时间】:2011-04-07 20:18:31
【问题描述】:
我的 python 程序有很多功能,当从 .py 脚本运行时,它们似乎都可以正常工作。使用 py2exe 编译后,有几段代码的行为非常不一致。
这部分的失败似乎非常一致。
def unzipItem(self, fileName, destination):
print "--unzipItem--"
zip = zipfile.ZipFile(fileName)
nameList = zip.namelist()
fileCount = 0
for item in nameList:
fileCount += 1
dlg = wx.ProgressDialog("Unziping files",
"An informative message",
fileCount,
parent = self,
)
keepGoing = True
count = 0
for item in nameList:
count += 1
dir,file = os.path.split(item)
print "unzip " + file
self.SetStatusText("Unziping " + str(item))
(keepGoing, skip) = dlg.Update(count, file)
zip.extract(item,destination)
zip.close()
dlg.Destroy()
ProcessDialog 永远不会出现,SetStatusText 永远不会更新 GUI。
【问题讨论】: