The following example shows how suites, families and tasks are added to a Python definition file.
Code Block | ||
---|---|---|
| ||
import ecflow |
...
if _name_ == "_main_": |
...
defs = ecFlow.Defs() # create an empty definition |
...
suite = defs.add_suite("s1"); # create a suite and add it to the defs |
...
family = suite.add_family("f1") # create a family and add it to suite |
...
for i in [ "a", "b", "c" ]: # create task ta,tb,tc |
...
family.add_task( "t" + i) # create a task and add to family |
...
defs.save_as_defs("my.def") # save defs to file "my.def" |