Page 1 of 1
Can periodic Python tasks be installed?
Posted: Wed Sep 20, 2023 4:25 am
by lowenthalm
I want to record camera cooler behavior periodically, probably every 30 seconds or so. Is there a way of installing Python script or function object that is called periodically?
Re: Can periodic Python tasks be installed?
Posted: Wed Sep 20, 2023 12:49 pm
by admin
Hi,
not sure if it is possible with raw python, but you have the whole of the .NET framework class library available to you because it is IronPython, so somethinf like this will work
Code: Select all
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Timer
def tick(sender,args):
print ("hello")
t = Timer()
t.Interval = 30000
t.Tick += tick
t.Start()
#later
t.Stop()
cheers,
Robin