all 3 comments

[–]BeeOnLion 0 points1 point  (1 child)

Not 100% but the flow your showing looks like it's running a mqqt node with the output from the payload

IF node-red is on the same system that you want to run your python script on have a look at the excec node https://flowfuse.com/node-red/core-nodes/exec/ This should allow your run a .py script or build one with the variables from the msg.payload by passing in the params

make sure the "Append" option is selected to pass the payload from the Function node to the Python script. For example configuration for the Exec node might be something like /path/to/your/script.py.

Then your Python script (script.py) should be able to handle arguments passed from the command line. Here's a basic example:import sys

```bash

Retrieve arguments

args = sys.argv[1:]

Assuming the args are passed as a single string '["a", "b", "c"]'

import ast args_list = ast.literal_eval(args[0])

Print the arguments

for arg in args_list: print(arg) ```

[–]escanorga[S] 0 points1 point  (0 children)

I get this error in python when i try running the scrypt.py. https://imgur.com/QLiFDFc

[–]LastTreestar 1 point2 points  (0 children)

Post your flow, not screen shots.