I have been treid to run a python mainmodel.py model (tha model uses a "mainmodel.py" model, from everything is commanded).
The problem is I can't run this model inside the loop in python. The ideia is run the model between diferent conditions, in sensibility analysis of the model (with many variations for each one of 15 parameters). I treid to use this: How to run a Python script from another Python script in the cross-platform way?
or
How to run a python script from another python script and get the returned status code?
My code to call a "mainmodel.py" is simple, only when a run the model, my code to call the "mainmodel.py" is:
###################################################
__author__ = 'Isaque'
import mainmodel
import subprocess
import sys
for t in range(3):
print 'MAJOR LOOP %s T'%t
for i in range(2):
subprocess.call((sys.executable, "mainmodel.py"))
print 'MINOR LOOP %s'%i
#################################################
The problem is, we need to test many parameters inside the model. Because to do that (in sensibility of analisys) automated!! Thanks in advance!! Isaque