I'm using Exec to call a python script, but for some reason, when I output using print(), its not being returned to Node-RED. Yet, it receives the debug output from using the logging library - I've also tried sending output to sys.stdout.write() and sys.stderr.write() and neither of then are returned.
I'm going to do a bit more digging - But I was wondering if anybody could offer some insight or suggestions?
Thanks dceejay, I was praying that would work, but its still not working.
My tests script is simple:
#!/usr/bin/python3 -u
import os
print("Test Out....")
I've tried calling the script directly, and also with the python interpreter.
python -u /vm-scripts/test.py
I did also try using the pythonshell node, which did work for returning the output, but I ran into a different issue, in I cannot easily pass parameters to the script with this.
@dceejay you sir, are a superstar, thank you so much. I was pulling my hair out with this for the past several evenings.. My mistake it seems, I was putting the full path script in the "Command" field.
Did you leave the append msg.payload option checked? Because this looks like you by accident appended a timestamp (probably from the inject node) to your commands.
But please open a new thread for questions like this as its no good appending your question to a two year old thread.