python 在编译成EXE 文件后报错 我实在是找不出原因
时间: 2019-11-24来源:开源中国
前景提要
HDC调试需求开发(15万预算),能者速来!>>>
代码在本地的pycharm上是可以正常运行的,但通过 pyinstaller -F -w 转换成EXE后就报错了

然后我用 CMD 运行 提示说

然后我也按照网上说的 在第一行 添加字符转换 可还是不行,到底是那个地方出错了呢? 请教下大家


我付上源代码: # -*- coding: utf-8 -*- import wx from win32con import AW_ACTIVATE, AW_BLEND, AW_CENTER, AW_HIDE, AW_HOR_NEGATIVE, \ AW_HOR_POSITIVE, AW_SLIDE, AW_VER_NEGATIVE, AW_VER_POSITIVE, SPI_GETWORKAREA import win32api from ctypes import windll, c_int class Popup(wx.MiniFrame): def __init__(self, label, parent=None, title=""): wx.MiniFrame.__init__(self, parent, -1, title, wx.DefaultPosition, size=(580, 280), style=wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP) for monitor in win32api.EnumDisplayMonitors(): monitor_info = win32api.GetMonitorInfo(monitor[0]) if monitor_info['Flags'] == 1: break workarea = monitor_info['Work'] pos = (workarea[2] - 580, workarea[3] - 280) bg = wx.Colour(255, 255, 225) self.SetBackgroundColour(bg) self.SetPosition(pos) text = wx.StaticText(self, -1, label) text.SetBackgroundColour(bg) flags = AW_SLIDE | AW_VER_NEGATIVE | AW_ACTIVATE windll.user32.AnimateWindow(c_int(self.GetHandle()), c_int(800), c_int(flags)) self.Refresh() self.Bind(wx.EVT_CLOSE, self.RemovePopup) def RemovePopup(self, evt=None): flags = AW_BLEND | AW_HIDE windll.user32.AnimateWindow(c_int(self.GetHandle()), c_int(800), c_int(flags)) self.Destroy() if __name__ == '__main__': app = wx.App(False) f = Popup('测试右下角弹出框\n测试右下角弹出框\n\n') f.Show() app.MainLoop()

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行