You can use python's commands
module to execute external commands and capture their output.
The module has a function commands.getstatusoutput(cmd)
, where cmd
is the command you are looking to run, as a string.
Something like this could do the trick:
import commands
for x in xrange(100):
commands.getstatusoutput("/home/Example.R")
Each iteration of the for loop, the commands.getstatusoutput()
function will even return a tuple (status, output)
, where status is the status after executing the program, and output being anything that the command would have written to stdout.
Hope that helps.