I hope this is the right forum for this. Anyway, I thought I'd share a small library called Patchbay I wrote for communicating with pd (max / msp / others should also work but haven't been tested).
You can download it here:
Check out the hello_world example. Basically you can easily bind stuff, like whatever you want in pd to functions or variables in python. All the events received are also recorded so you can record an hour of stuff happening in pd which your program reacts to, and then replay it (can also be useful if you want to render your code as a movie).
The project is in a kind of early stage but... I'm adding more stuff in patchbay as I'm using it. So yeah, that's that.
Oh, one more thing:
Yeah sure, you COULD use it as a way to trigger sound stuff in pd to python. But I mostly use it as a way to easily animate stuff. Say you have a program that draws something on the screen. Now you can just create keyframes and such in pd to control it.... etc etc
Ok, peace out