[PD] [announce] py 0.0.1 python script object / flext 0.2.1

Ben Saylor bsaylor at macalester.edu
Sat Mar 30 11:10:05 CET 2002


Ah, got it.  It works nicely. :)

There's one problem, though - changing a global variable in one instance
changes it for all others of the same script.  That makes it hard for
each instance to have its own state variables (I'm not even sure how it
would be done).  In case I'm not making sense (it's very late ;) take a
look at the attached patch and script.

Also, a minor bug: if a py object hasn't been given a function name yet
and you send something to its right inlet, pd crashes.

Thanks,
Ben

On Sat, Mar 30, 2002 at 09:44:11AM +0100, Thomas Grill wrote:
> am 30.03.2002 4:24 Uhr schrieb Ben Saylor unter bsaylor at macalester.edu:
> 
> > No problems compiling it, but when I load test.pd I get
> > 
> > ImportError: No module named scr2
> > ImportError: No module named scr1
> > ImportError: No module named scr1
> > ImportError: No module named scr2
> > ImportError: No module named scr2
> > 
> 
> py will search for the scripts in the pd path (-path option). Did you
> specify it to point to the script directory?
> 
> greetings, Thomas
> 
> 
-------------- next part --------------
x = 0

def getx():
	global x
	return x

def setx(newx):
	global x
	x = newx
-------------- next part --------------
#N canvas 0 214 450 300 10;
#X msg 40 47 reload;
#X obj 49 168 print;
#X obj 51 112 py s;
#X msg 146 44 set getx;
#X msg 149 68 set setx;
#X floatatom 157 102 5 0 0;
#X obj 196 134 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 239 71 reload;
#X obj 248 192 print;
#X obj 250 136 py s;
#X msg 345 68 set getx;
#X msg 348 92 set setx;
#X floatatom 356 126 5 0 0;
#X obj 395 158 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 2 1;
#X connect 6 0 2 1;
#X connect 7 0 9 0;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
#X connect 11 0 9 0;
#X connect 12 0 9 1;
#X connect 13 0 9 1;


More information about the Pd-list mailing list