2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-20 00:46:30 +08:00
artiq/examples/master/repository/arguments_demo.py

19 lines
589 B
Python

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)