artiq/examples/master/repository/run_forever.py

19 lines
420 B
Python
Raw Normal View History

from itertools import count
from time import sleep
2016-01-26 07:03:01 +08:00
from artiq.experiment import *
class RunForever(EnvExperiment):
def build(self):
self.setattr_device("scheduler")
def run(self):
try:
for i in count():
self.scheduler.pause()
sleep(1)
print("ping", i)
except TerminationRequested:
print("Terminated gracefully")