We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Is it possible to run/trig a shell command/script
Page Index Toggle Pages: 1
Is it possible to run/trig a shell command/script? (Read 1231 times)
Is it possible to run/trig a shell command/script?
Apr 5th, 2010, 6:19am
 
A link if you know of one? I'm trying to trigger a python script on the computer from processing. I saw something about a .command method, but can't find any docs on it.

Thanks in advance for any advice.

-fshrking
Re: Is it possible to run/trig a shell command/script?
Reply #1 - Apr 5th, 2010, 10:05am
 
Hi, there is a method I use often to invoke external script or command from processing..

Code:

try{
     Runtime.getRuntime().exec("myShinyScriptHere.py");
   }
   catch(java.io.IOException e){
     println(e);
   }

it seems to work fine, this method will run the command after the processing window is closed, so it is not fully interactive.. it depends on your needs, anyway I believe there is some workaround about this (on linux, xterm -e "command" & .., for example).

best,
kof
Page Index Toggle Pages: 1