wxpython 语言问题导致出现错误

原本可以执行的程序,也生成了exe文件,过了一段时间来执行出现以下错误:

wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ..\..\src\common\intl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!

 查询后发现语言问题导致的错误,只需在app后设置下:

app.locale = wx.Locale(wx.LANGUAGE_CHINESE_SIMPLIFIED)

这样就ok了!

你可能感兴趣的:(python)