.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 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 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 :ref:`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:: :ref:`wx.GetOsVersion`, :ref:`wx.IsPlatformLittleEndian`, :ref:`wx.IsPlatform64Bit`, :ref:`wx.AppTraits`, :ref:`Network, User and OS <network, user and os>`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>PlatformInformation</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/PlatformInfo_inheritance.png" alt="Inheritance diagram of PlatformInformation" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="PlatformInfo.html" title="PlatformInfo" alt="" coords="5,5,104,35"/> </map> 
   </p>

|


|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`` .
:meth:`~wx.PlatformInformation.CheckToolkitVersion`                              Returns ``True`` if the toolkit version is at least  ``major.minor`` .
:meth:`~wx.PlatformInformation.Get`                                              Returns the global :ref:`PlatformInfo`  object, initialized with the values for the currently running platform.
:meth:`~wx.PlatformInformation.GetArch`                                          Converts the given string to a Architecture enum value or to  ``ARCH_INVALID``   if the given string is not a valid architecture string (i.e.
:meth:`~wx.PlatformInformation.GetArchName`                                      Returns the name for the architecture of this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetArchitecture`                                  Returns the architecture ``ID`` of this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetDesktopEnvironment`                            Returns the desktop environment associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetEndianness`                                    Returns the endianness ``ID`` of this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetEndiannessName`                                Returns the name for the endianness of this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetLinuxDistributionInfo`                         Returns the Linux distribution info associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetOSMajorVersion`                                Returns the run-time major version of the OS associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetOSMinorVersion`                                Returns the run-time minor version of the OS associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetOperatingSystemDescription`                    Returns the description of the operating system of this :ref:`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 :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetOperatingSystemId`                             Returns the operating system ``ID`` of this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetOperatingSystemIdName`                         Returns the operating system name of the OS associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetPortId`                                        Returns the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetPortIdName`                                    Returns the name of the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetPortIdShortName`                               Returns the short name of the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetToolkitMajorVersion`                           Returns the run-time major version of the toolkit associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.GetToolkitMinorVersion`                           Returns the run-time minor version of the toolkit associated with this :ref:`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 :ref:`PlatformInfo`  describes wxUniversal build.
:meth:`~wx.PlatformInformation.SetArchitecture`                                  Sets the architecture enum value associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetDesktopEnvironment`                            Sets the desktop environment associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetEndianness`                                    Sets the endianness enum value associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetLinuxDistributionInfo`                         Sets the linux distribution info associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetOSVersion`                                     Sets the version of the operating system associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetOperatingSystemDescription`                    Sets the operating system description associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetOperatingSystemId`                             Sets the operating system associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetPortId`                                        Sets the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.
:meth:`~wx.PlatformInformation.SetToolkitVersion`                                Sets the version of the toolkit associated with this :ref:`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.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.OSMajorVersion`                                   See :meth:`~wx.PlatformInformation.GetOSMajorVersion`
: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.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, arch=ARCH_INVALID, endian=ENDIAN_INVALID)
   
   This class holds information about the operating system, the toolkit
   and the basic architecture of the machine where the application is
   currently running.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__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`     
      
      
      
      
      
      
      
      **~~~**

      
      **__init__** `(self, pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, arch=ARCH_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 `arch`: 
      :type `arch`: wx.Architecture
      :param `endian`: 
      :type `endian`: wx.Endianness
      
      
      
      
      
      
      **~~~**






   .. method:: CheckOSVersion(self, major, minor)

      Returns ``True`` if the OS version is at least  ``major.minor`` .                   

                


      :param `major`: 
      :type `major`: int
      :param `minor`: 
      :type `minor`: int




      :rtype: `bool`







      .. seealso:: :meth:`GetOSMajorVersion` , :meth:`GetOSMinorVersion` , :meth:`CheckToolkitVersion`     








   .. method:: CheckToolkitVersion(self, major, minor)

      Returns ``True`` if the toolkit version is at least  ``major.minor`` .                   

                


      :param `major`: 
      :type `major`: int
      :param `minor`: 
      :type `minor`: int




      :rtype: `bool`







      .. seealso:: :meth:`GetToolkitMajorVersion` , :meth:`GetToolkitMinorVersion` , :meth:`CheckOSVersion`     








   .. staticmethod:: Get()

      Returns the global :ref:`PlatformInfo`  object, initialized with the values for the currently running platform.                  

      :rtype: :ref:`PlatformInfo`








   .. staticmethod:: GetArch(arch)

      Converts the given string to a Architecture enum value or to  ``ARCH_INVALID``   if the given string is not a valid architecture string (i.e.                   

      does not contain nor  ``32``   nor   ``64``   strings).                   


      :param `arch`: 
      :type `arch`: string




      :rtype: :ref:`wx.Architecture`








   .. method:: GetArchName(self)

      Returns the name for the architecture of this :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetArchitecture(self)

      Returns the architecture ``ID`` of this :ref:`PlatformInfo`  instance.                  

      :rtype: :ref:`wx.Architecture`








   .. method:: GetDesktopEnvironment(self)

      Returns the desktop environment associated with this :ref:`PlatformInfo`  instance.                  

      See :meth:`wx.AppTraits.GetDesktopEnvironment`   for more info.                  

      :rtype: `string`








   .. method:: GetEndianness(self)

      Returns the endianness ``ID`` of this :ref:`PlatformInfo`  instance.                  

      :rtype: :ref:`wx.Endianness`








   .. method:: GetEndiannessName(self)

      Returns the name for the endianness of this :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetLinuxDistributionInfo(self)

      Returns the Linux distribution info associated with this :ref:`PlatformInfo`  instance.                  

      See :ref:`wx.GetLinuxDistributionInfo`  for more info.                  

      :rtype: :ref:`wx.LinuxDistributionInfo`








   .. method:: GetOSMajorVersion(self)

      Returns the run-time major version of the OS associated with this :ref:`PlatformInfo`  instance.                  

                

      :rtype: `int`







      .. seealso:: :ref:`wx.GetOsVersion`, :meth:`CheckOSVersion`     








   .. method:: GetOSMinorVersion(self)

      Returns the run-time minor version of the OS associated with this :ref:`PlatformInfo`  instance.                  

                

      :rtype: `int`







      .. seealso:: :ref:`wx.GetOsVersion`, :meth:`CheckOSVersion`     








   .. method:: GetOperatingSystemDescription(self)

      Returns the description of the operating system of this :ref:`PlatformInfo`  instance.                  

      See :ref:`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 :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetOperatingSystemId(self)

      Returns the operating system ``ID`` of this :ref:`PlatformInfo`  instance.                  

      See :ref:`wx.GetOsVersion`  for more info.                  

      :rtype: :ref:`wx.OperatingSystemId`








   .. method:: GetOperatingSystemIdName(self)

      Returns the operating system name of the OS associated with this :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetPortId(self)

      Returns the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.                  

      :rtype: :ref:`wx.PortId`








   .. method:: GetPortIdName(self)

      Returns the name of the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetPortIdShortName(self)

      Returns the short name of the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.                  

      :rtype: `string`








   .. method:: GetToolkitMajorVersion(self)

      Returns the run-time major version of the toolkit associated with this :ref:`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:: GetToolkitMinorVersion(self)

      Returns the run-time minor version of the toolkit associated with this :ref:`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 :ref:`PlatformInfo`  describes wxUniversal build.                  

      :rtype: `bool`








   .. method:: SetArchitecture(self, n)

      Sets the architecture enum value associated with this :ref:`PlatformInfo`  instance.                  


      :param `n`: 
      :type `n`: wx.Architecture







   .. method:: SetDesktopEnvironment(self, de)

      Sets the desktop environment associated with this :ref:`PlatformInfo`  instance.                  


      :param `de`: 
      :type `de`: string







   .. method:: SetEndianness(self, n)

      Sets the endianness enum value associated with this :ref:`PlatformInfo`  instance.                  


      :param `n`: 
      :type `n`: wx.Endianness







   .. method:: SetLinuxDistributionInfo(self, di)

      Sets the linux distribution info associated with this :ref:`PlatformInfo`  instance.                  


      :param `di`: 
      :type `di`: wx.LinuxDistributionInfo







   .. method:: SetOSVersion(self, major, minor)

      Sets the version of the operating system associated with this :ref:`PlatformInfo`  instance.                  


      :param `major`: 
      :type `major`: int
      :param `minor`: 
      :type `minor`: int







   .. method:: SetOperatingSystemDescription(self, desc)

      Sets the operating system description associated with this :ref:`PlatformInfo`  instance.                  


      :param `desc`: 
      :type `desc`: string







   .. method:: SetOperatingSystemId(self, n)

      Sets the operating system associated with this :ref:`PlatformInfo`  instance.                  


      :param `n`: 
      :type `n`: wx.OperatingSystemId







   .. method:: SetPortId(self, n)

      Sets the wxWidgets port ``ID`` associated with this :ref:`PlatformInfo`  instance.                  


      :param `n`: 
      :type `n`: wx.PortId







   .. method:: SetToolkitVersion(self, major, minor)

      Sets the version of the toolkit associated with this :ref:`PlatformInfo`  instance.                  


      :param `major`: 
      :type `major`: int
      :param `minor`: 
      :type `minor`: 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:: 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:: OSMajorVersion

      See :meth:`~wx.PlatformInformation.GetOSMajorVersion`


   .. 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:: ToolkitMinorVersion

      See :meth:`~wx.PlatformInformation.GetToolkitMinorVersion`

