Hi!
I am using an Exec node to run a python script, this python script has a while that doesn't stop (This while get data from a car), but node-red doens't show data before the loop are finish o/
I am using the option: "while the command is running - spawn mode". I can't use the option: "while the command is complete - exec mode", because it will cause loss of performance.
How can I get data in Node-RED every time the loop runs without having to wait the loop stops (Loop cannot stop)?
Did you read the info box that specifically mentions -u option for not buffering python commands ?
1 Like
Yeahh, but it didn't work for me
Maybe I am doing it wrong:
Are you passing -u to your app ? Or the python process ? Looks like the app to me
1 Like
How can I pass -u to a python process? Sorry, I don't know this
Ok, now it is solved ^^.
In my python script I use:
print('RPM',rpmi[0:-23], flush = True)
This is a way to do it: "flush = True", but, now I want to know how to use this "-u" thing, you can teach me?
Put the -u after python3 rather that add it to the end
python3 -u yourapp.py
1 Like
Ohhh loord, thank you @dceejay !