Platforms to show: All Mac Windows Linux Cross-Platform

Back to PythonMBS class.

PythonMBS.ExecPrefix as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the exec-prefix for installed platform-dependent files.

This is derived through a number of complicated rules from the program name set with Py_SetProgramName() and some environment variables; for example, if the program name is '/usr/local/bin/python', the exec-prefix is '/usr/local'.
The value is available to Python code as sys.exec_prefix. It is only useful on Unix.

Background: The exec-prefix differs from the prefix when platform dependent files (such as executables and shared libraries) are installed in a different directory tree. In a typical installation, platform dependent files may be installed in the /usr/local/plat subtree while platform independent may be installed in /usr/local.

Generally speaking, a platform is a combination of hardware and software families, e.g. Sparc machines running the Solaris 2.x operating system are considered the same platform, but Intel machines running Solaris 2.x are another platform, and Intel machines running Linux are yet another platform. Different major revisions of the same operating system generally also form different platforms. Non-Unix operating systems are a different story; the installation strategies on those systems are so different that the prefix and exec-prefix are meaningless, and set to the empty string. Note that compiled Python bytecode files are platform independent (but not independent from the Python version by which they were compiled!).

System administrators will know how to configure the mount or automount programs to share /usr/local between platforms while having /usr/local/plat be a different filesystem for each platform.
(Read only property)

PythonMBS.LibraryBuildInfo as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return information about the sequence number and build date and time of the current Python interpreter instance.
Example
MessageBox PythonMBS.LibraryBuildInfo

The value is available to Python code as part of the variable sys.version.

e.g. returns "main, Dec 3 2024, 17:59:52"
(Read only property)

PythonMBS.LibraryCompiler as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return an indication of the compiler used to build the current Python version, in square brackets.
Example
MessageBox PythonMBS.LibraryCompiler

The value is available to Python code as part of the variable sys.version.

e.g. returns [Clang 16.0.0 (clang-1600.0.26.4)]
(Read only property)

PythonMBS.LibraryCopyright as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the official copyright string for the current Python version.
Example
MessageBox PythonMBS.LibraryCopyright

The value is available to Python code as sys.copyright.
(Read only property)

PythonMBS.LibraryError as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
The error message from Load methods in case of the error.

(Read only property)

PythonMBS.LibraryPlatform as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the platform identifier for the current platform.
Example
MessageBox PythonMBS.LibraryPlatform

On Unix, this is formed from the “official” name of the operating system, converted to lower case, followed by the major revision number; e.g., for Solaris 2.x, which is also known as SunOS 5.x, the value is 'sunos5'. On macOS, it is 'darwin'. On Windows, it is 'win'.
The value is available to Python code as sys.platform.

Value is e.g. "darwin" on macOS.
(Read only property)

PythonMBS.LibraryVersion as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Queries the version text of the Python library.

Returns e.g. "3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]"
(Read only property)

PythonMBS.Loaded as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Queries whether Python libraries have been loaded.

Returns true if loaded or false if not.
(Read only property)

PythonMBS.MonotonicTime as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Read the monotonic clock.
Example
MessageBox PythonMBS.MonotonicTime.ToString

e.g. 1221942957636375
(Read only property)

PythonMBS.Path as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the default module search path.

This is computed from the program name (set by assigning ProgramName) and some environment variables. The returned string consists of a series of directory names separated by a platform dependent delimiter character. The delimiter character is ':' on Unix and macOS, ';' on Windows.
The list sys.path is initialized with this value on interpreter startup; it can be (and usually is) modified later to change the search path for loading modules.

e.g.
/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python312.zip:/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12:/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
(Read only property)

PythonMBS.Prefix as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the prefix for installed platform-independent files.

This is derived through a number of complicated rules from the program name set with Py_SetProgramName() and some environment variables; for example, if the program name is '/usr/local/bin/python', the prefix is '/usr/local'.
The value is available to Python code as sys.prefix. It is only useful on Unix.
(Read only property)

PythonMBS.ProgramFullPath as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Return the full program name of the Python executable

This is computed as a side-effect of deriving the default module search path from the program name (set by assignment to ProgramName).
The value is available to Python code as sys.executable.
This is usually the path to your Xojo application.
(Read only property)

PythonMBS.ProgramName as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
The program name.

Can be set before initializing Python, otherwise the default will be "python".
(Read and Write property)

PythonMBS.PythonHome as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 24.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
The default "home" path.

The value is set by a previous with setting PythonHome property, or the value is the value of the PYTHONHOME environment variable if it is set.
(Read and Write property)

PythonMBS.RecursionLimit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
The recursion limit.

Default is 1000.
(Read and Write property)

PythonMBS.Time as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Python MBS Python Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes Desktop, Console & Web
Read the “wall clock” time.
Example
MessageBox PythonMBS.Time.ToString

Return the time in seconds since the epoch as a floating-point number. The handling of leap seconds is platform dependent. On Windows and most Unix systems, the leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as Unix time.

e.g. 1743330201673808000
(Read only property)

The items on this page are in the following plugins: MBS Python Plugin.


The biggest plugin in space...