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

from apscheduler.scheduler import Scheduler


if __name__ == '__main__':
    scheduler = Scheduler(standalone=True)
    scheduler.add_interval_job('sys:stdout.write', args=['tick\n'], seconds=3)
    print('Press Ctrl+C to exit')
    try:
        scheduler.start()
    except (KeyboardInterrupt, SystemExit):
        pass