forked from M-Labs/artiq
1
0
Fork 0
artiq/examples/master/repository/arguments_demo.py

19 lines
589 B
Python
Raw Normal View History

2015-07-18 22:25:08 +08:00
from artiq import *
class ArgumentsDemo(EnvExperiment):
def build(self):
self.attr_argument("free_value", FreeValue(None))
self.attr_argument("boolean", BooleanValue(True))
self.attr_argument("enum", EnumerationValue(
["foo", "bar", "quux"], "foo"))
self.attr_argument("number", NumberValue(42, unit="s", step=0.1))
self.attr_argument("string", StringValue("Hello World"))
def run(self):
print(self.free_value)
print(self.boolean)
print(self.enum)
print(self.number)
print(self.string)