Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Python Extensions for Geosoft Desktop Applications

Python extensions that run from Geosoft Desktop  will Applications will run from a python interpreter that is executed within the context of the Geosoft Desktop Applications program.  Geosoft Geosoft Desktop does Applications does not ship with its own Python interpreter, and users who wish to run Python extensions must install the 64-bit Python 3.4 5 or later. Geosoft  Geosoft Desktop Applications uses dynamic loading with a version-independent Python C API for embedded Python script executions. This means any Windows x64 Python distribution that uses Python 3.4 or higher can be used.

The location and behavior of the Python interpreter for running Python extensions inside Geosoft inside Geosoft Desktop Applications is determined either by environment variables, or if not set, by registry keys.  Geosoft Geosoft Desktop users Applications users can also define registry keys using the "Settings > Global settings > Python..." menu item and then re-starting Geosoft Desktop Applications.

,
Environment VarableVariableRegistry Key Use
GEOSOFT_PYTHON_HOMEPYTHON_HOMEFolder that contains Python distribution (3.45+) to use. This folder contains python.exe.GEOSOFT_PYTHON_DLLPYTHON_DLLGeosoft Desktop will attempt to launch a background process of the python.exe interpreter found using PYTHON_HOME, from which process inspection is used to determine the location of python.dll. The PYTHON_DLL variable should not be necessary, but is provided to deal with a non-standard Python implementation.
GEOSOFT_PYTHON_SHOW_CONSOLE PYTHON_SHOW_CONSOLE  If '1' (true) - a console is spawned for the duration of every script. Console input and output (such as the output from print() statements) is directed to and from this console. The console remains open after termination of the script and requires the user to close the console window, or enter ctrl-C at the keyboard.
GEOSOFT_PYTHON_DLL

...

PYTHON_DLLGeosoft Desktop will attempt to launch a background process of the python.exe interpreter found using PYTHON_HOME, from which process inspection is used to determine the location of python.dll. The PYTHON_DLL variable should not be necessary, but is provided to deal with a non-standard Python implementation.

Stand-alone Python Programs

Stand-alone Python programs satisfy GX API calls from the geodist.dll, which is part of a normal Geosoft Desktop Applications installation.  It It is also possible to distribute applications that locate this file as part of the Geosoft redistributable dlls.  In In this case, the GX_GEOSOFT_BIN_PATH environment variable must identify the folder that contains geodist.dll.