本文整理汇总了Python中win32api.GetVersionEx方法的典型用法代码示例。如果您正苦于以下问题:Python win32api.GetVersionEx方法的具体用法?Python win32api.GetVersionEx怎么用?Python win32api.GetVersionEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32api
的用法示例。
在下文中一共展示了win32api.GetVersionEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InitInstance
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import GetVersionEx [as 别名]
def InitInstance(self):
" Called to crank up the app "
numMRU = win32ui.GetProfileVal("Settings","Recent File List Size", 10)
win32ui.LoadStdProfileSettings(numMRU)
# self._obj_.InitMDIInstance()
if win32api.GetVersionEx()[0]<4:
win32ui.SetDialogBkColor()
win32ui.Enable3dControls()
# install a "callback caller" - a manager for the callbacks
# self.oldCallbackCaller = win32ui.InstallCallbackCaller(self.CallbackManager)
self.LoadMainFrame()
self.SetApplicationPaths()
示例2: get_platform
# 需要导入模块: import win32api [as 别名]
# 或者: from win32api import GetVersionEx [as 别名]
def get_platform():
global os
rv = OSInfo()
rv.platform = sys.platform
if sys.platform.startswith("linux"):
import os # making this global breaks on IronPython
osname, _, kernel, _, arch = os.uname()
rv.arch = arch
rv.osname = osname
rv.osversion = kernel
rv.distribution, rv.release = _get_linux_dist()
elif sys.platform.startswith("darwin"):
import os # making this global breaks on IronPython
osname, _, kernel, _, arch = os.uname()
rv.arch = arch
rv.osname = osname
rv.osversion = kernel
rv.distribution, rv.release = _get_darwin_dist()
elif sys.platform in ("win32", "cli"):
import os
rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
rv.osname = os.environ["OS"]
rv.distribution = "Microsoft"
if sys.platform == "win32":
import win32api
major, minor, build, api, extra = win32api.GetVersionEx()
rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
rv.release = "Unknown"
elif sys.platform == "cli":
rv.osversion = "Unknown"
rv.release = "Unknown"
return rv