I use Python subprocess.call () to run a series of python scripts, each of which runs Matlab scripts. The problem is when the first Matlab script ends.
An external Python script parses the csv file directory for settings to run experiments based on each line of csv files. For each experiment, it calls a python program to run data analysis and feed into Matlab. Matlab then launches each experiment. Except that the whole thing comes out after the first launch of Matlab. Can Matlab get out of its subprocess to reduce all this?
for line in csvfile: if debug: print 'Experiment %d' % count ts = line.split(',') startStamp=ts[0] cmdargs = ['python prep_lssvm.py'] cmdargs.append(str(site)) cmdargs.append(str(startStamp)) cmdargs.append(str(daysTraining)) if debug: print cmdargs for i in range(len(argv)-2): cmdargs.append(str(argv[i+2])) command = ' '.join(cmdargs) if debug: print command call(command,shell=True) #Never goes past here<<<<<<======================= dirname = ''.join([site,'_',str(count)]) mkdir(dirname) call(''.join(['mv ',site,'/*.txt ',dirname]),shell=True,stdout=outfile)
source share