Python print statement

I’m looking to observe/debug my python node in action by inserting diagnostic print statements at key points (yes, crude but effective). How does one monitor standard Python “print”, or is the only feedback through the OUT parameter?


Ned R

Usually you will create an empty list called debug and append results to debug. Lastly you assign debug to OUT

Well. I found one way, which is to redirect stdout to a file:

stdsave = sys.stdout
fout = open(r’C:\Users\Ned.Reifenstein\output.txt’,‘w’)
sys.stdout = fout
print “This is a message”

sys.stdout = stdsave

This way you can keep diagnostic print statements out of the way of OUT. However, it sure would be nice to redirect stdout to the dynamo console.



1 Like

Great idea - please make feature request for this on GitHub.