Sharing Python scripts in a collaborative environment

The simplest method to execute a Python script is to drag and drop that script file to the Python terminal. Oil and Gas companies typically share their script on a shared directory and users are free to choose scripts from that directory.

INTViewer offers better alternatives than drag and drop. You can define a "Python Directory" where INTViewer will automatically search for scripts at startup. If Python scripts are found, they will show automatically in the "Scripts" menu, as well as all contextual menus where they are defined.

To setup that directory, users typically use the Tools->Options->Environment->Paths dialog (or Tools->Options->Python->Scripts in INTViewer 5.2).

In large deployments, it is often impractical to have each user perform that setup. To simplify this deployment, just set the PYTHON_SCRIPTS_PATH_PROPERTY environment variable to the directory that all users should use.

On Windows 10, environment variables are set through this Window Settings screen:

Remember that updates to Python scripts are effective immediately. No need to restart INTViewer to get the latest version of a script. However, if a script has been added or removed, users might need to "Refresh" the list of scripts.

Note that users can customize which scripts they want to use. The "Python Scripts" dialog makes it possible to move any "Selected" script to the "Available" column, effectively removing that script from the environment. Moving scripts to the "Available" category only affects that one instance of INTViewer. Other users are not affected. By default, all scripts are selected.

The scripts directory can have sub-directories. In a highly collaborative environment where several script authors contribute, consider having a dedicated directory for each author. The "Categories" dropdown makes it easy to filter which scripts you want to keep. Remember that all script names must be unique: if two scripts have the same name, only one of them will be accessible.