#!/usr/bin/python import sys,getopt,os; opts, args = getopt.getopt(sys.argv[1:],"r:R:l:L:") RUNS = [] loc = 'localdir/' for d in os.listdir(loc): if d.startswith('run3'): r = d[3:8] RUNS.append(r) RUNS.sort(); for r in RUNS: cmd = 'root -b -q \"findmpvs.C('+r+')\"' print cmd os.system(cmd)