1, Package app error
Use Py2app,mac package into app, exception, program exit directly.
Without a specific error message, the client program crashes directly.
2, Reason
The code does not have a few lines:
#!/usr/bin/python# -*- coding: utf-8 -*-import wxapp = wx.App(False) # Create a new app, don‘t redirect stdout/stderr to a window.frame = wx.Frame(None, wx.ID"测试"# A Frame is a top-level window.frame.Show(True) # Show the frame.app.MainLoop()
Because the Chinese error in the inside, although the code is set Utf-8 but the Chinese also need to become Unicode, the character before the addition of U.
Modified to:
frame = wx.Frame(Noneu"测试")
You can run the package again.
Multiple module packaging
The direct import package will automatically play the module into the app file.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Python (3): Wxpython package app, error