system doesnt work to me

Hi , i need to open a python script when my of app starts, so i using the command system inside my setup function in my testApp.cpp :

void testApp::setup(){

system(“script.py”);

I have the python script inside the data folder that is inside bin.
when i compile the app it runs ok, withouth problems but it never opens the script

Is anybody im doing wrong?
Any idea?
Is there any documentation about the system command?

thanks

Try placing the python script adjacent to the .exe (in the /bin folder instead of /bin/data).

http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx

first, probably you need to type “python script.py” at the prompt – at least on mac you need to do this since the command line doesn’t execute the .py file. maybe this is different on pc?

as an alternative to kyle’s suggestion – you can always add the path to the data folder. While the OF functions that work with a file add the path to the data folder to the string, other non-OF functions (like system) don’t, so you could try adding that path with the ofToDataPath() function:

  
system( "python " + ofToDataPath("script.py"));  

does that help?

take care,
zach