[PD] Does someone have a working program to communicate with Pd over UDP?

Winfried Ritsch ritsch at iem.at
Mon Aug 19 09:15:53 CEST 2002


Maybe someone needs,

a primitive python function in a script to send messeages to pd, its
done for the Zope server as External method, so you can control pd
over Zope or use it in an main function.

-------- cut ---------------------
## Script (Python) 
## parameters = REQUEST, pdhost, pdport, pdmessage
##
##!/usr/bin/python

"""Import socket library, create a socket connection in TCP and send data to pd
   which should have a netreceive to get the message """
   
import socket

def sendpd(pdhost='seneca.iemnet',pdport=4000,pdmessage='nothing special;'):

	s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	s.connect((pdhost, pdport))
	s.send(pdmessage)
	s.close()

	return pdmessage
-------- cut ----------------------


mfg winfried ritsch




More information about the Pd-list mailing list