Execute Python2 script with payload

Until now I have executed Python scripts using an exec node in this way:

python -u /home/pi/....../script.py

and everything works great.
I have a situation now where I need to execute a Python2 script with a payload. In terminal I execute it in this way and it works fine: python2 ./sendsigfox1.py 123abc
The script send the message 123abc on sigfox uplink.

How can I do that with a nodered exec node passing the payload (123abc ) as an argument to the script?
I would appreciate some help. Being an hobbyist,..... at time is difficult.
Thank you


Should work - make sure you add a space at the end of the command line after .py

And you tick the Append msg.payload

Thank you. Perfect

1 Like

in general for python I would add the -u flag as well to ensure any output is unbuffered and sent back immediately... eg python2 -u /path...

1 Like

Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.