In Python there is not a switch/case statement, however, this can be worked round around using nested if..elif..else commands.
Code Block |
---|
var = "aa" if var in ( "a", "aa", "aaa" ) : print "it is a kind of a "; elif var in ( "b", "bb", "bb" ) :print "it is a kind of b "; else : print "it is something else "; |
Using for loops
Code Block |
---|
suite = ecflow.Suite("x") previous = 0 for i in (0,6,12,18,24) : fam = suite.add_family(str(i)) if i != 0 : fam.add_trigger += Trigger("./" + previous + " == complete ") fam.add_task("t1" += Task('t1') fam.add_task("t2").add_trigger += Task('t2', Trigger("t1 == complete")) previous = str(i) |
...