Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
from ecflow import defsDefs,Suite,Variable,Edit

defs = Defs()
s1 = defs.add_suite("s1") 
s1.add_variable("HELLO","world") # name, value
s1.add_variable({ "NAME":"value", "NAME2":"value2", "NAME3":"value3", "NAME4":4 }  )
s1.add_variable(Variable("FRED","bloggs"))
s1.add_variable(Variable("BILL","1"))

The following examples show alternative styles that produce the same definition:


Code Block
languagepy
defs = Defs().add(
        Suite("s1").add(
          Edit(HELLO="world",
               FRED="bloggs",BILL=1,NAME="value",
               NAME2="value2",
               NAME3="value3",NAME4=4)))



Code Block
languagepy
 defs = Defs()
 defs += [Suite("s1")]
 defs.s1 += [ Edit(HELLO="world"),
              Edit({ "NAME":"value", "NAME2":"value2", 
                     "NAME3":"value3", "NAME4":4 },
                    BILL=1),
              Edit(FRED="bloggs")]