Hello all,
Before I really start getting into it, is anyone working on, or finished a pyx external that does what "shell" had done? (to solve the stability issues)
I figured something that runs os.system() on an arbitrary string would be a good enough start, though coercing the _anything_ *args into a string seems to be challenging me.
Anyhow I just wanted to throw it out in case someone is already using such a thing.
Thanks, B.
Hi,
I figured something that runs os.system() on an arbitrary string would be a good enough start, though coercing the _anything_ *args into a string seems to be challenging me.
do you mean "".join(map(str,*args)) ?
gr~~~
-- Thomas Grill http://grrrr.org
Am 29.01.2008 um 00:20 schrieb Thomas Grill:
Hi,
I figured something that runs os.system() on an arbitrary string would be a good enough start, though coercing the _anything_ *args into a string seems to be challenging me.
do you mean "".join(map(str,*args)) ?
no sorry, if args is a sequence i think you rather mean
os.system(" ".join(map(str,args)))
In this case the arguments are separated by spaces.
gr~~~
-- Thomas Grill http://grrrr.org
Hi Thomas!
I have something working, but looks like I need to use os.popen4 to capture the output.
Ah, the map trick is much more concise than a for loop.
I may be done soon enough, hope I'm not overdoing too much of someone else's work, since I think shell needs a stable replacement!
.b.
Thomas Grill wrote:
Am 29.01.2008 um 00:20 schrieb Thomas Grill:
Hi,
I figured something that runs os.system() on an arbitrary string would be a good enough start, though coercing the _anything_ *args into a string seems to be challenging me.
do you mean "".join(map(str,*args)) ?
no sorry, if args is a sequence i think you rather mean
os.system(" ".join(map(str,args)))
In this case the arguments are separated by spaces.
gr~~~
-- Thomas Grill http://grrrr.org
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hey Thomas ++
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..
looping through all the types and testing is the string could be coerced seems less fun.
Thanks, .b.
Thomas Grill wrote:
Am 29.01.2008 um 00:20 schrieb Thomas Grill:
Hi,
I figured something that runs os.system() on an arbitrary string would be a good enough start, though coercing the _anything_ *args into a string seems to be challenging me.
do you mean "".join(map(str,*args)) ?
no sorry, if args is a sequence i think you rather mean
os.system(" ".join(map(str,args)))
In this case the arguments are separated by spaces.
gr~~~
-- Thomas Grill http://grrrr.org
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
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:
it only returns a single number (cpu or memory usage)
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~~~