Can periodic Python tasks be installed?
-
- Posts: 152
- Joined: Mon May 07, 2018 12:27 am
Can periodic Python tasks be installed?
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?
- admin
- Site Admin
- Posts: 13350
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Can periodic Python tasks be installed?
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
cheers,
Robin
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()
Robin