.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2025 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.VersionInfo: ========================================================================================================================================== |phoenix_title| **wx.VersionInfo** ========================================================================================================================================== :ref:`wx.VersionInfo` contains version information. This class is used by wxWidgets to provide version information about the libraries it uses and itself, but you can also apply it in user space, to provide version information about your own libraries, or other libraries that you use. For example, if you are including Lua in your program, you can gather its library info as such: .. versionadded:: 2.9.2 | |class_hierarchy| Class Hierarchy ================================= .. raw:: html

Inheritance diagram of VersionInfo

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.VersionInfo.__init__` Constructor. :meth:`~wx.VersionInfo.AtLeast` Return ``True`` if the version is at least equal to the given one. :meth:`~wx.VersionInfo.GetCopyright` Get the copyright string. :meth:`~wx.VersionInfo.GetDescription` Get the description string. :meth:`~wx.VersionInfo.GetMajor` Get the major version number. :meth:`~wx.VersionInfo.GetMicro` Get the micro version, or release number. :meth:`~wx.VersionInfo.GetMinor` Get the minor version number. :meth:`~wx.VersionInfo.GetName` Get the name of the object (library). :meth:`~wx.VersionInfo.GetNumericVersionString` Get the string representation of only numeric version components. :meth:`~wx.VersionInfo.GetRevision` Get the revision version, or build number. :meth:`~wx.VersionInfo.GetVersionString` Get the string representation. :meth:`~wx.VersionInfo.HasCopyright` Returns ``True`` if a copyright string has been specified. :meth:`~wx.VersionInfo.HasDescription` Return ``True`` if a description string has been specified. :meth:`~wx.VersionInfo.IsOk` Return ``True`` if there is actually at least some version information. :meth:`~wx.VersionInfo.ToString` Get the string representation of this version object. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.VersionInfo.Copyright` See :meth:`~wx.VersionInfo.GetCopyright` :attr:`~wx.VersionInfo.Description` See :meth:`~wx.VersionInfo.GetDescription` :attr:`~wx.VersionInfo.Major` See :meth:`~wx.VersionInfo.GetMajor` :attr:`~wx.VersionInfo.Micro` See :meth:`~wx.VersionInfo.GetMicro` :attr:`~wx.VersionInfo.Minor` See :meth:`~wx.VersionInfo.GetMinor` :attr:`~wx.VersionInfo.Name` See :meth:`~wx.VersionInfo.GetName` :attr:`~wx.VersionInfo.NumericVersionString` See :meth:`~wx.VersionInfo.GetNumericVersionString` :attr:`~wx.VersionInfo.Revision` See :meth:`~wx.VersionInfo.GetRevision` :attr:`~wx.VersionInfo.VersionString` See :meth:`~wx.VersionInfo.GetVersionString` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.VersionInfo(object) **Possible constructors**:: VersionInfo(name="", major=0, minor=0, micro=0, revision=0, description="", copyright="") -> None VersionInfo contains version information. .. method:: __init__(self, name="", major=0, minor=0, micro=0, revision=0, description="", copyright="") Constructor. The version information objects need to be initialized with this constructor and are immutable once they are created. :param `name`: The name of the library or other entity that this object pertains to. :type `name`: string :param `major`: The major version component. :type `major`: int :param `minor`: The minor version component. :type `minor`: int :param `micro`: The micro version component, 0 by default. :type `micro`: int :param `revision`: The revision version component, also known as "build number". This component is also 0 by default and is only available since wxWidgets 3.2.0. :type `revision`: int :param `description`: Free form description of this version, none by default. :type `description`: string :param `copyright`: Copyright string, none by default. :type `copyright`: string :rtype: `None` .. method:: AtLeast(self, major, minor=0, micro=0) Return ``True`` if the version is at least equal to the given one. :param `major`: Major version to compare with. :type `major`: int :param `minor`: Optional minor version to compare with. :type `minor`: int :param `micro`: Optional micro version to compare with. :type `micro`: int :rtype: `bool` :returns: ``True`` if this version is equal to or greater than the given one. .. versionadded:: 4.3/wxWidgets-3.3.0 .. method:: GetCopyright(self) Get the copyright string. The copyright string may be empty. :rtype: `str` :returns: The copyright string. .. method:: GetDescription(self) Get the description string. The description may be empty. :rtype: `str` :returns: The description string, free-form. .. method:: GetMajor(self) Get the major version number. :rtype: `int` :returns: Major version number. .. method:: GetMicro(self) Get the micro version, or release number. This is the third component of the version. :rtype: `int` :returns: Micro version, or release number. .. method:: GetMinor(self) Get the minor version number. :rtype: `int` :returns: Minor version number. .. method:: GetName(self) Get the name of the object (library). :rtype: `str` :returns: Name string. .. method:: GetNumericVersionString(self) Get the string representation of only numeric version components. The micro and revision components of the version are ignored/not used if they are both zero. If the revision component is non-zero all four parts will be used even if the micro component is zero. :rtype: `str` :returns: The version string in the form "major.minor[.micro[.revision]]". .. versionadded:: 4.3/wxWidgets-3.3.0 .. method:: GetRevision(self) Get the revision version, or build number. This is the fourth component of the version. :rtype: `int` :returns: Revision version, or build number. .. versionadded:: 4.2/wxWidgets-3.2.0 .. method:: GetVersionString(self) Get the string representation. The micro and revision components of the version are ignored/not used if they are both zero. If the revision component is non-zero all four parts will be used even if the micro component is zero. Note that this function includes the name of the object this version is defined for, if this is undesired, use :meth:`GetNumericVersionString` instead. :rtype: `str` :returns: The version string in the form "name major.minor[.micro[.revision]]". .. method:: HasCopyright(self) Returns ``True`` if a copyright string has been specified. :rtype: `bool` .. seealso:: :meth:`GetCopyright` .. method:: HasDescription(self) Return ``True`` if a description string has been specified. :rtype: `bool` .. seealso:: :meth:`GetDescription` .. method:: IsOk(self) Return ``True`` if there is actually at least some version information. For the default-constructed object, this function returns ``False``, allowing to distinguish it from any object filled with the version information. :rtype: `bool` .. versionadded:: 4.3/wxWidgets-3.3.0 .. method:: ToString(self) Get the string representation of this version object. This function returns the description if it is non-empty or :meth:`GetVersionString` if there is no description. :rtype: `str` .. seealso:: :meth:`GetDescription` , :meth:`GetVersionString` .. attribute:: Copyright See :meth:`~wx.VersionInfo.GetCopyright` .. attribute:: Description See :meth:`~wx.VersionInfo.GetDescription` .. attribute:: Major See :meth:`~wx.VersionInfo.GetMajor` .. attribute:: Micro See :meth:`~wx.VersionInfo.GetMicro` .. attribute:: Minor See :meth:`~wx.VersionInfo.GetMinor` .. attribute:: Name See :meth:`~wx.VersionInfo.GetName` .. attribute:: NumericVersionString See :meth:`~wx.VersionInfo.GetNumericVersionString` .. attribute:: Revision See :meth:`~wx.VersionInfo.GetRevision` .. attribute:: VersionString See :meth:`~wx.VersionInfo.GetVersionString`