There is a python script which reads a benchmark name from command line like this:
-b benchname1
The code for this perpose is:
import optparse
import Mybench
parser = optparse.OptionParser()
# Benchmark options
parser.add_option("-b", "--benchmark", default="", help="The benchmark to be loaded.")
if options.benchmark == 'benchname1':
process = Mybench.b1
elif options.benchmark == 'benchname2':
process = Mybench.b2
else:
print "no such benchmark!"
what I want to do is to create a an array of benchmarks for this command line:
-b benchname1 benchname2
So the "process" should be an array that is:
process[0] = Mybench.b1
process[1] = Mybench.b2
Is there any suggestion for that?
Thanx