Keywords: gildas-python

Next: Developers of Fortran GILDAS Up: Python 3K Previous: Standard end-user Contents Index

## Developers using the Python binding

If you are in charge of a Python module or package integrated in Gildas, you should be aware of the following:

- as Gildas supports both Python 2 and 3, you are asked to provide your scripts with Python 2 syntax only. If needed, the scripts will be processed by the `2to3` Python tool at compilation time. Try also to use Python 3 syntax backported to Python 2 as much as possible in order to limit the differences between both syntaxes.
- if your scripts are part of a Python module, they will be implicitly Python-compiled14 at compilation time. This pre-compilation is always done sooner or later by Python at first use of the module. Our intent is to offer this compilation for users who do not have write-access to the module installation path (e.g. shared installations of Gildas). See link for details.
- designing the hierarchy of your Python package and (sub)modules is less trivial than it seems. Check carefully the relative imports guidelines as described e.g. in `https://docs.python.org/2/faq/programming.html#what-are-the-best-practices- for-using-import-in-a-module`

Next: Developers of Fortran GILDAS Up: Python 3K Previous: Standard end-user Contents Index