Python#

The Python module allows you to load your Python source code (Python 2 or Python 3) directly into Lattix. There are two options for loading your Python project into Lattix.

The first option (Python (Understand)) uses the output of SciTools Understand. You will input either a .und file (Understand 6 and above) or a .udb file (Understand 4 and 5) into Lattix. This works for both Python 2 and Python 3, but you will need to have SciTools Understand installed on your machine. Python (Understand) has the following:

  • Dependencies: Include, Data, Class Method, Declaration

  • Atom Kinds: Abstract Class, Class, Data, Member, Header File, Method, Source File

The second option (Python) can take one of four different data sources:

image0

  • Python 3 Files with this option you can add individual Python files to a directory containing all of your Python files. This option uses Pydeps to parse the dependency information in the Python source files. Pydeps is an open-source tool that creates dependency information from Python 3 files. To use this option, you will need to install the Pydeps executable on your machine and configure Lattix to find the Pydeps executable. View Python options to learn how to configure Lattix to use Pydeps.

  • Pydeps JSON File (only for Python 3) with this option you can import the Pydeps JSON file directly into Lattix. Pydeps must be installed first. Pydeps is an open-source tool that creates dependency information from Python 3 files.

  • Python 2 snakefood ldi file and Python 2 snakefood ldi.xml file for these two options you will use a combination of snakewood which is an open-source dependency parser and Python Analyzer. First, you will run snakewood over your Python codebase then you will take the output of snakewood and input that into Lattix’s Python Analyzer. This will generate a LDI file which can be loaded into Lattix. You will need to have snakewood installed first. You can find more information on the Python Analyzer here

Options#

pydeps command
Set this value so Lattix knows where to find the pydeps command
Set the values in the View->Preferences dialog so that they can be used by all New Python projects.
image1

Lattix command line#

If using the Lattix command line only, you can set this property by setting the value directly in the file
$HOME/.lattix/lattix_<username>.properties
lattix.plugin.python.PYDEPS_CMD=/usr/local/bin/pydeps

Command line support#

First set the location of the pydeps command as shown in the “Options” page above.
Be aware that any options set in the above step will only be honored for newly created projects.
Example how how to create Lattix project for python using ldcupdate.
ldcupdate project.ldz -module:python py:python-code-directory