I think I figured this out... the first argument in the list should be the name of the program. So try:
import os args = 'C:\Program Files\pd\bin\pd.exe', '-nogui', 'mypatch.pd' os.spawnv(os.P_NOWAIT, 'C:\Program Files\pd\bin\pd.exe', args)
(I tried running pd from python on my linux system and debugged the problem by replacing pd with /bin/echo. Linux highly recommended :)
cheers Miller
On Mon, Aug 28, 2006 at 10:57:43PM -0700, altern wrote:
hi
Few months ago i was asking about how to launch pd from python, at that time i was getting some weird error i couldnt solve. I finally found what was wrong (forgot to pass the path to pd with \ ) but now i have another issue to solve.
Basically i am using this code to load PD and open a patch
import os args = '-nogui', 'mypatch.pd' # this is a tupple with the arguments for pd, the last is the file to open os.spawnv(os.P_NOWAIT, 'C:\Program Files\pd\bin\pd.exe', args)
It opens pd and the patch fine. But the -nogui doesnt work. I tried with other flags like -noaudio and this time they do work. I am wondering if this has anything to do with the pd console or something like that. Maybe it doesnt like being launched from python? As a test I explored this other method:
os.startfile(run.bat)
where the run.bat contains the comand pd -nogui mypatch.pd
this works fine running pd as process only, but the console of the .bat stays open and i am trying to avoid any kind of window, i want PD to be invisible.
I am testing it on windows XP at the moment but I want to use a crossplatform method, this is another reason to avoid the .bat
any one has some ideas about how to get this running as i need?
many thanks
enrike
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list