Python print statement

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
fout.close()


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