本文整理匯總了Python中wxversion.ensureMinimal方法的典型用法代碼示例。如果您正苦於以下問題:Python wxversion.ensureMinimal方法的具體用法?Python wxversion.ensureMinimal怎麽用?Python wxversion.ensureMinimal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wxversion
的用法示例。
在下文中一共展示了wxversion.ensureMinimal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: init_stage2
# 需要導入模塊: import wxversion [as 別名]
# 或者: from wxversion import ensureMinimal [as 別名]
def init_stage2(use_gui):
"""Initialise the remaining (non-path) parts of wxGlade (second stage)
use_gui: Starting wxGlade GUI"""
config.use_gui = use_gui
if use_gui:
# import proper wx-module using wxversion, which is only available in Classic
if compat.IS_CLASSIC:
if not hasattr(sys, "frozen") and 'wx' not in sys.modules:
try:
import wxversion
wxversion.ensureMinimal('2.8')
except ImportError:
msg = _('Please install missing Python module "wxversion".')
logging.error(msg)
sys.exit(msg)
try:
import wx
except ImportError:
msg = _('Please install missing Python module "wxPython".')
logging.error(msg)
sys.exit(msg)
# store current version and platform ('not_set' is default)
config.platform = wx.Platform
config.wx_version = wx.__version__
if sys.platform=="win32":
# register ".wxg" extension
try:
import msw
msw.register_extensions(["wxg"], "wxGlade")
except ImportError:
pass
# codewrites, widgets and sizers are loaded in class main.wxGladeFrame
else:
# use_gui has to be set before importing config
common.init_preferences()
common.init_codegen()