In this example we see several ways to insert Pure Data comments on the patch.
1importpdpy_libaspdpy 2 3withpdpy.PdPy(name='comments',root=True)aspd: 4 5comments=pd.createComment( 6"This is a comment", 7"This is yet another one, on the same; object", 8"note that semis and commas are escaped, internally." 9)1011many=101213# the function above is a convenience function for the following one14another=pdpy.Comment("Now we've made "+str(many)+" comments")1516forninrange(1,many):17pd.createComment("we repeated "+str(n)+" times.")1819another.addtext('You can add more text to a comment')20pd.create(another)21another.addtext('before or after you have created it.')2223# for example, the first comment is returned as a list, so24comments[0].addtext('neat, right?')2526final=pd.createComment("Also, you can have very very long texts and specify your own breaking point, for example by setting the border property to, say, 250")27final[0].border=250
CommentsΒΆ
In this example we see several ways to insert Pure Data comments on the patch.