On a Windows machine, you need to install Python version 3 or higher and be able to run the py command from the console.

First select Descriptor as node type and then select Python script as the method. Select the python script file using the Browse button or type the path to the script file directly.


Python file

Select the python file.


  • Object

    • Applies the python file content on the objects.

  • Pixels

    • Applies the python file content on the pixels.

Simple python script for a descriptor

import sys

    with open(sys.argv[1], "r") as f:
        frames = f.read().splitlines()
    count = 0
    totSum = 0
    result = []
    for frame in frames:
        values = list(map(float, frame.split(";")))
        totSum += sum(values)
        count += len(values)

    result.append(totSum / count)

except Exception as inst:
    exc_type, exc_obj, exc_tb = sys.exc_info()
    print("Error: {0}, at line {1}".format(inst, exc_tb.tb_lineno))

Example input to the script

The input to the script is saved to a temp file and the absolute path to the file is passed as an argument to the script.

Is in an array:


Example output from the script

The output has to be printed from the python script to be returned to Breeze: print(result).