Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 898 Bytes

python.rst

File metadata and controls

26 lines (18 loc) · 898 Bytes

Python

Adding items to the Python path

The example below runs a simple model that depends on a user produced package. It uses a wrapper script to add the items to the PYTHONPATH environment variables so the package can be imported into model.py.

Here is our dummy package. It just has a variable we are going to use in model.py

../../examples/cookbook/python/python-path/a_package.py

Here is our model.py. It imports our package and then prints the variables defined in our model

../../examples/cookbook/python/python-path/model.py

This is our idmtools orchestration script to run the add our package, define our python task, and wrap that with a bash script.

../../examples/cookbook/python/python-path/python-path.py