[PD] launching PD from python (again)

altern altern2 at gmail.com
Tue Aug 29 07:57:43 CEST 2006


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





More information about the Pd-list mailing list