原本可以执行的程序,也生成了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了!
本文解决了一个关于wxPython程序在执行过程中遇到的语言设置错误,通过设置app的locale为简化中文,成功解决了C++断言失败的问题。

1899

被折叠的 条评论
为什么被折叠?



