Using Python Print Statement in Dynamo


I always hated not being able to use print statements in Dynamo’s Python node. After using the StringIO module on another project, I just realized I could use it for a similar effect.

The code below allows you to redirect python print statements to the OUT variable of a Python Node in Dynamo.

In the absence of a debugger, I find it helpful to add print statements through the code to make it easier to troubleshoot it. It doesn’t actually stream it in the way a stdout typically would, but it does store all the data printed, and then you can assign the value to your OUT output.

Print Statements In Dynamo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.