FV Python Tools PS

From TUFLOW FV Wiki
Revision as of 19:35, 10 October 2019 by Mitch3007 (Talk | contribs) (Toolbox download and set up)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is currently under construction.

Install PyScripter

Once you have downloaded and installed Python, you can use an IDE to edit, run and debug your scripts.

To download PyScripter, please visit https://sourceforge.net/projects/pyscripter/ .

Proceed to download PyScripter using the most recent executable download file for windows and run the installation.

Configure Pyscripter

In order to configure PyScripter for the visualisations detailed in this tutorial, please set the Remote Python Engine to Tk as per the below.

Remote Tk.png

Toolbox download and set up

To run Python scipts for TUFLOW FV, a toolbox of supporting functions has been provided on the TUFLOW FV Utilities page.

For Python to access and use the TUFLOW FV Python Toolbox, it will either need to be added to the Python Path, or located within the same folder as your Python scripts. It is recommended that the toolbox is added to the Python Path, so that you have increased versatility with your working folder. You can access Python Path settings using your IDE. In PyScripter this will involve navigating to Tools > Python Path (see below).

Python path.JPG

From here you will be able to see the directories currently located on the Python Path. Of these directories you will notice the site-packages folder.

Python paths.png

The site-packages folder is always included on the Python Path, and therefore provides an ideal location to place the TUFLOW FV Python Toolbox.

Copy the Python Toolbox folder to the site-packages directory to add the toolbox to path.

Once successfully setup with PyScripter please head back to Tutorial Module 05.