.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.PlatformInformation: ========================================================================================================================================== |phoenix_title| **wx.PlatformInformation** ========================================================================================================================================== This class holds information about the operating system, the toolkit and the basic architecture bitness of the machine where the application is currently running. This class does not only have `getters` for the information above, it also has `setters`. This allows you to e.g. save the current platform information in a data file (maybe in string form) so that when you later load it, you can easily retrieve (see the static getters for string.enum conversion functions) and store inside a `PlatformInfo` instance (using its setters) the signature of the system which generated it. In general however you only need to use the static :meth:`~wx.PlatformInformation.Get` function and then access the various information for the current platform: :: wx.LogMessage("This application is running under %s." % wx.PlatformInformation.Get().GetOperatingSystemIdName()) .. seealso:: `wx.GetOsVersion` , `wx.IsPlatformLittleEndian` , `wx.IsPlatform64Bit` , :ref:`wx.AppTraits`, :ref:`Network, User and OS ` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class PlatformInformation:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.PlatformInformation.__init__` Initializes the instance with the values corresponding to the currently running platform. :meth:`~wx.PlatformInformation.CheckOSVersion` Returns ``True`` if the OS version is at least ``major.minor.micro`` . :meth:`~wx.PlatformInformation.CheckToolkitVersion` Returns ``True`` if the toolkit version is at least ``major.minor.micro`` . :meth:`~wx.PlatformInformation.Get` Returns the global `PlatformInfo` object, initialized with the values for the currently running platform. :meth:`~wx.PlatformInformation.GetArch` :meth:`~wx.PlatformInformation.GetArchName` :meth:`~wx.PlatformInformation.GetArchitecture` :meth:`~wx.PlatformInformation.GetBitness` Returns the architecture bitness ``ID`` of this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetBitnessName` Returns the name for the given Bitness enumeration value. :meth:`~wx.PlatformInformation.GetCpuArchitectureName` Returns the ``CPU`` architecture name, if available. :meth:`~wx.PlatformInformation.GetDesktopEnvironment` Returns the desktop environment associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetEndianness` Returns the endianness ``ID`` of this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetEndiannessName` Returns the name for the endianness of this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetLinuxDistributionInfo` Returns the Linux distribution info associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetNativeCpuArchitectureName` Returns the native ``CPU`` architecture name, if available. :meth:`~wx.PlatformInformation.GetOSMajorVersion` Returns the run-time major version of the OS associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOSMicroVersion` Returns the run-time micro version of the OS associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOSMinorVersion` Returns the run-time minor version of the OS associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOperatingSystemDescription` Returns the description of the operating system of this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOperatingSystemDirectory` Returns the operating system directory. :meth:`~wx.PlatformInformation.GetOperatingSystemFamilyName` Returns the operating system family name of the OS associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOperatingSystemId` Returns the operating system ``ID`` of this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetOperatingSystemIdName` Returns the operating system name of the OS associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetPortId` Returns the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetPortIdName` Returns the name of the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetPortIdShortName` Returns the short name of the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetToolkitMajorVersion` Returns the run-time major version of the toolkit associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetToolkitMicroVersion` Returns the run-time micro version of the toolkit associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.GetToolkitMinorVersion` Returns the run-time minor version of the toolkit associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.IsOk` Returns ``True`` if this instance is fully initialized with valid values. :meth:`~wx.PlatformInformation.IsUsingUniversalWidgets` Returns ``True`` if this `PlatformInfo` describes wxUniversal build. :meth:`~wx.PlatformInformation.SetArchitecture` :meth:`~wx.PlatformInformation.SetBitness` Sets the architecture bitness enum value associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetDesktopEnvironment` Sets the desktop environment associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetEndianness` Sets the endianness enum value associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetLinuxDistributionInfo` Sets the linux distribution info associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetOSVersion` Sets the version of the operating system associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetOperatingSystemDescription` Sets the operating system description associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetOperatingSystemId` Sets the operating system associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetPortId` Sets the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.SetToolkitVersion` Sets the version of the toolkit associated with this `PlatformInfo` instance. :meth:`~wx.PlatformInformation.__ne__` Inequality operator. :meth:`~wx.PlatformInformation.__eq__` Equality operator. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.PlatformInformation.ArchName` See :meth:`~wx.PlatformInformation.GetArchName` :attr:`~wx.PlatformInformation.Architecture` See :meth:`~wx.PlatformInformation.GetArchitecture` and :meth:`~wx.PlatformInformation.SetArchitecture` :attr:`~wx.PlatformInformation.Bitness` See :meth:`~wx.PlatformInformation.GetBitness` and :meth:`~wx.PlatformInformation.SetBitness` :attr:`~wx.PlatformInformation.BitnessName` See :meth:`~wx.PlatformInformation.GetBitnessName` :attr:`~wx.PlatformInformation.CpuArchitectureName` See :meth:`~wx.PlatformInformation.GetCpuArchitectureName` :attr:`~wx.PlatformInformation.DesktopEnvironment` See :meth:`~wx.PlatformInformation.GetDesktopEnvironment` and :meth:`~wx.PlatformInformation.SetDesktopEnvironment` :attr:`~wx.PlatformInformation.Endianness` See :meth:`~wx.PlatformInformation.GetEndianness` and :meth:`~wx.PlatformInformation.SetEndianness` :attr:`~wx.PlatformInformation.EndiannessName` See :meth:`~wx.PlatformInformation.GetEndiannessName` :attr:`~wx.PlatformInformation.LinuxDistributionInfo` See :meth:`~wx.PlatformInformation.GetLinuxDistributionInfo` and :meth:`~wx.PlatformInformation.SetLinuxDistributionInfo` :attr:`~wx.PlatformInformation.NativeCpuArchitectureName` See :meth:`~wx.PlatformInformation.GetNativeCpuArchitectureName` :attr:`~wx.PlatformInformation.OSMajorVersion` See :meth:`~wx.PlatformInformation.GetOSMajorVersion` :attr:`~wx.PlatformInformation.OSMicroVersion` See :meth:`~wx.PlatformInformation.GetOSMicroVersion` :attr:`~wx.PlatformInformation.OSMinorVersion` See :meth:`~wx.PlatformInformation.GetOSMinorVersion` :attr:`~wx.PlatformInformation.OperatingSystemDescription` See :meth:`~wx.PlatformInformation.GetOperatingSystemDescription` and :meth:`~wx.PlatformInformation.SetOperatingSystemDescription` :attr:`~wx.PlatformInformation.OperatingSystemFamilyName` See :meth:`~wx.PlatformInformation.GetOperatingSystemFamilyName` :attr:`~wx.PlatformInformation.OperatingSystemId` See :meth:`~wx.PlatformInformation.GetOperatingSystemId` and :meth:`~wx.PlatformInformation.SetOperatingSystemId` :attr:`~wx.PlatformInformation.OperatingSystemIdName` See :meth:`~wx.PlatformInformation.GetOperatingSystemIdName` :attr:`~wx.PlatformInformation.PortId` See :meth:`~wx.PlatformInformation.GetPortId` and :meth:`~wx.PlatformInformation.SetPortId` :attr:`~wx.PlatformInformation.PortIdName` See :meth:`~wx.PlatformInformation.GetPortIdName` :attr:`~wx.PlatformInformation.PortIdShortName` See :meth:`~wx.PlatformInformation.GetPortIdShortName` :attr:`~wx.PlatformInformation.ToolkitMajorVersion` See :meth:`~wx.PlatformInformation.GetToolkitMajorVersion` :attr:`~wx.PlatformInformation.ToolkitMicroVersion` See :meth:`~wx.PlatformInformation.GetToolkitMicroVersion` :attr:`~wx.PlatformInformation.ToolkitMinorVersion` See :meth:`~wx.PlatformInformation.GetToolkitMinorVersion` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.PlatformInformation(object) PlatformInfo() PlatformInfo(pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, bitness=BITNESS_INVALID, endian=ENDIAN_INVALID) This class holds information about the operating system, the toolkit and the basic architecture bitness of the machine where the application is currently running. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Initializes the instance with the values corresponding to the currently running platform. This is a fast operation because it only requires to copy the values internally cached for the currently running platform. .. seealso:: :meth:`Get` :html:`

` **__init__** `(self, pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, bitness=BITNESS_INVALID, endian=ENDIAN_INVALID)` Initializes the object using given values. :param `pid`: :type `pid`: wx.PortId :param `tkMajor`: :type `tkMajor`: int :param `tkMinor`: :type `tkMinor`: int :param `id`: :type `id`: wx.OperatingSystemId :param `osMajor`: :type `osMajor`: int :param `osMinor`: :type `osMinor`: int :param `bitness`: :type `bitness`: wx.Bitness :param `endian`: :type `endian`: wx.Endianness :html:`

` .. method:: CheckOSVersion(self, major, minor, micro=0) Returns ``True`` if the OS version is at least ``major.minor.micro`` . :param `major`: :type `major`: int :param `minor`: :type `minor`: int :param `micro`: :type `micro`: int :rtype: `bool` .. seealso:: :meth:`GetOSMajorVersion` , :meth:`GetOSMinorVersion` , :meth:`GetOSMicroVersion` , :meth:`CheckToolkitVersion` .. method:: CheckToolkitVersion(self, major, minor, micro=0) Returns ``True`` if the toolkit version is at least ``major.minor.micro`` . :param `major`: :type `major`: int :param `minor`: :type `minor`: int :param `micro`: :type `micro`: int :rtype: `bool` .. seealso:: :meth:`GetToolkitMajorVersion` , :meth:`GetToolkitMinorVersion` , :meth:`GetToolkitMicroVersion` , :meth:`CheckOSVersion` .. staticmethod:: Get() Returns the global `PlatformInfo` object, initialized with the values for the currently running platform. :rtype: `PlatformInfo` .. staticmethod:: GetArch(arch) :param `arch`: :type `arch`: string :rtype: :ref:`wx.Architecture` .. wxdeprecated:: Use :meth:`GetBitness` instead. .. method:: GetArchName(self) :rtype: `string` .. wxdeprecated:: Use :meth:`GetBitnessName` instead. .. method:: GetArchitecture(self) :rtype: :ref:`wx.Architecture` .. wxdeprecated:: Use :meth:`GetBitness` instead. .. method:: GetBitness(self) Returns the architecture bitness ``ID`` of this `PlatformInfo` instance. :rtype: :ref:`wx.Bitness` .. versionadded:: 4.1/wxWidgets-3.1.5 .. staticmethod:: GetBitnessName(*args, **kw) |overload| Overloaded Implementations: :html:`

` **GetBitnessName** `(bitness)` Returns the name for the given Bitness enumeration value. :param `bitness`: :type `bitness`: wx.Bitness :rtype: `string` .. versionadded:: 4.1/wxWidgets-3.1.5 :html:`

` **GetBitnessName** `(self)` Returns the name for the architecture bitness of this `PlatformInfo` instance. :rtype: `string` .. versionadded:: 4.1/wxWidgets-3.1.5 :html:`

` .. method:: GetCpuArchitectureName(self) Returns the ``CPU`` architecture name, if available. :rtype: `string` .. versionadded:: 4.1/wxWidgets-3.1.5 .. seealso:: `wx.GetCpuArchitectureName` , `wx.GetNativeCpuArchitectureName` .. method:: GetDesktopEnvironment(self) Returns the desktop environment associated with this `PlatformInfo` instance. See :meth:`wx.AppTraits.GetDesktopEnvironment` for more info. :rtype: `string` .. method:: GetEndianness(self) Returns the endianness ``ID`` of this `PlatformInfo` instance. :rtype: :ref:`wx.Endianness` .. method:: GetEndiannessName(self) Returns the name for the endianness of this `PlatformInfo` instance. :rtype: `string` .. method:: GetLinuxDistributionInfo(self) Returns the Linux distribution info associated with this `PlatformInfo` instance. See `wx.GetLinuxDistributionInfo` for more info. :rtype: :ref:`wx.LinuxDistributionInfo` .. method:: GetNativeCpuArchitectureName(self) Returns the native ``CPU`` architecture name, if available. :rtype: `string` .. versionadded:: 4.1/wxWidgets-3.1.6 .. seealso:: `wx.GetNativeCpuArchitectureName` , `wx.GetCpuArchitectureName` .. method:: GetOSMajorVersion(self) Returns the run-time major version of the OS associated with this `PlatformInfo` instance. :rtype: `int` .. seealso:: `wx.GetOsVersion` , :meth:`CheckOSVersion` .. method:: GetOSMicroVersion(self) Returns the run-time micro version of the OS associated with this `PlatformInfo` instance. :rtype: `int` .. versionadded:: 4.1/wxWidgets-3.1.1 .. seealso:: `wx.GetOsVersion` , :meth:`CheckOSVersion` .. method:: GetOSMinorVersion(self) Returns the run-time minor version of the OS associated with this `PlatformInfo` instance. :rtype: `int` .. seealso:: `wx.GetOsVersion` , :meth:`CheckOSVersion` .. method:: GetOperatingSystemDescription(self) Returns the description of the operating system of this `PlatformInfo` instance. See `wx.GetOsDescription` for more info. :rtype: `string` .. staticmethod:: GetOperatingSystemDirectory() Returns the operating system directory. See :meth:`GetOSDirectory` for more info. :rtype: `string` .. method:: GetOperatingSystemFamilyName(self) Returns the operating system family name of the OS associated with this `PlatformInfo` instance. :rtype: `string` .. method:: GetOperatingSystemId(self) Returns the operating system ``ID`` of this `PlatformInfo` instance. See `wx.GetOsVersion` for more info. :rtype: :ref:`wx.OperatingSystemId` .. method:: GetOperatingSystemIdName(self) Returns the operating system name of the OS associated with this `PlatformInfo` instance. :rtype: `string` .. method:: GetPortId(self) Returns the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :rtype: :ref:`wx.PortId` .. method:: GetPortIdName(self) Returns the name of the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :rtype: `string` .. method:: GetPortIdShortName(self) Returns the short name of the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :rtype: `string` .. method:: GetToolkitMajorVersion(self) Returns the run-time major version of the toolkit associated with this `PlatformInfo` instance. Note that if :meth:`GetPortId` returns ``PORT_BASE`` , then this value is zero (unless externally modified with :meth:`SetToolkitVersion` ); that is, no native toolkit is in use. See :meth:`wx.AppTraits.GetToolkitVersion` for more info. :rtype: `int` .. seealso:: :meth:`CheckToolkitVersion` .. method:: GetToolkitMicroVersion(self) Returns the run-time micro version of the toolkit associated with this `PlatformInfo` instance. Note that if :meth:`GetPortId` returns ``PORT_BASE`` , then this value is zero (unless externally modified with :meth:`SetToolkitVersion` ); that is, no native toolkit is in use. See :meth:`wx.AppTraits.GetToolkitVersion` for more info. :rtype: `int` .. versionadded:: 4.1/wxWidgets-3.1.1 .. seealso:: :meth:`CheckToolkitVersion` .. method:: GetToolkitMinorVersion(self) Returns the run-time minor version of the toolkit associated with this `PlatformInfo` instance. Note that if :meth:`GetPortId` returns ``PORT_BASE`` , then this value is zero (unless externally modified with :meth:`SetToolkitVersion` ); that is, no native toolkit is in use. See :meth:`wx.AppTraits.GetToolkitVersion` for more info. :rtype: `int` .. seealso:: :meth:`CheckToolkitVersion` .. method:: IsOk(self) Returns ``True`` if this instance is fully initialized with valid values. :rtype: `bool` .. method:: IsUsingUniversalWidgets(self) Returns ``True`` if this `PlatformInfo` describes wxUniversal build. :rtype: `bool` .. method:: SetArchitecture(self, n) :param `n`: :type `n`: wx.Architecture .. wxdeprecated:: Use :meth:`SetBitness` instead. .. method:: SetBitness(self, n) Sets the architecture bitness enum value associated with this `PlatformInfo` instance. :param `n`: :type `n`: wx.Bitness .. versionadded:: 4.1/wxWidgets-3.1.5 .. method:: SetDesktopEnvironment(self, de) Sets the desktop environment associated with this `PlatformInfo` instance. :param `de`: :type `de`: string .. method:: SetEndianness(self, n) Sets the endianness enum value associated with this `PlatformInfo` instance. :param `n`: :type `n`: wx.Endianness .. method:: SetLinuxDistributionInfo(self, di) Sets the linux distribution info associated with this `PlatformInfo` instance. :param `di`: :type `di`: wx.LinuxDistributionInfo .. method:: SetOSVersion(self, major, minor, micro=0) Sets the version of the operating system associated with this `PlatformInfo` instance. :param `major`: :type `major`: int :param `minor`: :type `minor`: int :param `micro`: :type `micro`: int .. method:: SetOperatingSystemDescription(self, desc) Sets the operating system description associated with this `PlatformInfo` instance. :param `desc`: :type `desc`: string .. method:: SetOperatingSystemId(self, n) Sets the operating system associated with this `PlatformInfo` instance. :param `n`: :type `n`: wx.OperatingSystemId .. method:: SetPortId(self, n) Sets the wxWidgets port ``ID`` associated with this `PlatformInfo` instance. :param `n`: :type `n`: wx.PortId .. method:: SetToolkitVersion(self, major, minor, micro=0) Sets the version of the toolkit associated with this `PlatformInfo` instance. :param `major`: :type `major`: int :param `minor`: :type `minor`: int :param `micro`: :type `micro`: int .. method:: __ne__(self) Inequality operator. Tests all class' internal variables. :param `t`: :type `t`: PlatformInfo .. method:: __eq__(self) Equality operator. Tests all class' internal variables. :param `t`: :type `t`: PlatformInfo .. attribute:: ArchName See :meth:`~wx.PlatformInformation.GetArchName` .. attribute:: Architecture See :meth:`~wx.PlatformInformation.GetArchitecture` and :meth:`~wx.PlatformInformation.SetArchitecture` .. attribute:: Bitness See :meth:`~wx.PlatformInformation.GetBitness` and :meth:`~wx.PlatformInformation.SetBitness` .. attribute:: BitnessName See :meth:`~wx.PlatformInformation.GetBitnessName` .. attribute:: CpuArchitectureName See :meth:`~wx.PlatformInformation.GetCpuArchitectureName` .. attribute:: DesktopEnvironment See :meth:`~wx.PlatformInformation.GetDesktopEnvironment` and :meth:`~wx.PlatformInformation.SetDesktopEnvironment` .. attribute:: Endianness See :meth:`~wx.PlatformInformation.GetEndianness` and :meth:`~wx.PlatformInformation.SetEndianness` .. attribute:: EndiannessName See :meth:`~wx.PlatformInformation.GetEndiannessName` .. attribute:: LinuxDistributionInfo See :meth:`~wx.PlatformInformation.GetLinuxDistributionInfo` and :meth:`~wx.PlatformInformation.SetLinuxDistributionInfo` .. attribute:: NativeCpuArchitectureName See :meth:`~wx.PlatformInformation.GetNativeCpuArchitectureName` .. attribute:: OSMajorVersion See :meth:`~wx.PlatformInformation.GetOSMajorVersion` .. attribute:: OSMicroVersion See :meth:`~wx.PlatformInformation.GetOSMicroVersion` .. attribute:: OSMinorVersion See :meth:`~wx.PlatformInformation.GetOSMinorVersion` .. attribute:: OperatingSystemDescription See :meth:`~wx.PlatformInformation.GetOperatingSystemDescription` and :meth:`~wx.PlatformInformation.SetOperatingSystemDescription` .. attribute:: OperatingSystemFamilyName See :meth:`~wx.PlatformInformation.GetOperatingSystemFamilyName` .. attribute:: OperatingSystemId See :meth:`~wx.PlatformInformation.GetOperatingSystemId` and :meth:`~wx.PlatformInformation.SetOperatingSystemId` .. attribute:: OperatingSystemIdName See :meth:`~wx.PlatformInformation.GetOperatingSystemIdName` .. attribute:: PortId See :meth:`~wx.PlatformInformation.GetPortId` and :meth:`~wx.PlatformInformation.SetPortId` .. attribute:: PortIdName See :meth:`~wx.PlatformInformation.GetPortIdName` .. attribute:: PortIdShortName See :meth:`~wx.PlatformInformation.GetPortIdShortName` .. attribute:: ToolkitMajorVersion See :meth:`~wx.PlatformInformation.GetToolkitMajorVersion` .. attribute:: ToolkitMicroVersion See :meth:`~wx.PlatformInformation.GetToolkitMicroVersion` .. attribute:: ToolkitMinorVersion See :meth:`~wx.PlatformInformation.GetToolkitMinorVersion`