Hi Ben,

Is there any flext/pyx magic for converting from python types to PD types?

The way I'm using shell has two cases:

1. it only returns a single number (cpu or memory usage)

2. it executes an xset command, and does not care about output.

So for now I'm assuming these cases.

Ideally it would be nice if a command output this: "0 10 0.3" then
outlet would send a list of three floats. "0 dog" as a message of a
float and a symbol etc..


this is done exactly like this by the py/pyext external.
Attached is a patch and a script that can act as a shell replacement.

gr~~~


Attachment: shell-test.pd
Description: Binary data

import os,pyext

def shell(*args):
	s = " ".join(map(str,args))
	f = os.popen(s)
	r = f.read().split()
	f.close()
	return r
	
class shellx(pyext._class):
    def _anything_1(self,*args):
        s = " ".join(map(str,args))
    	f = os.popen(s)
    	for fi in f.readlines():
    	    self._outlet(1,fi.split())
        f.close()
        self._outlet(2)
    	

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
PD-dev mailing list
[email protected]
http://lists.puredata.info/listinfo/pd-dev

Reply via email to