summaryrefslogtreecommitdiff
path: root/examples/reference.py
blob: 2b0c4141ab2456ca25a014a0184faef78c7c2af7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
Basic example showing how to schedule a callable using a textual reference.
"""

from apscheduler.schedulers.blocking import BlockingScheduler


if __name__ == '__main__':
    scheduler = BlockingScheduler()
    scheduler.add_job('sys:stdout.write', 'interval', {'seconds': 3}, args=['tick\n'])
    print('Press Ctrl+C to exit')

    try:
        scheduler.start()
    except (KeyboardInterrupt, SystemExit):
        pass