# Observer Timer Event Examples

**URL:** https://discourse.vtk.org/t/observer-timer-event-examples/13176
**Category:** Support
**Tags:** python
**Created:** [January 30, 2024, 1:28am UTC](https://discourse.vtk.org/t/observer-timer-event-examples/13176 "2024-01-30T01:28:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cam](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/bbe5ce/32.png) [@cam](https://discourse.vtk.org/u/cam)
#### Post date: [January 30, 2024, 1:28am UTC](https://discourse.vtk.org/t/observer-timer-event-examples/13176/1 "2024-01-30T01:28:39Z")

</div>

Hey all,

I’m looking to use a timer event to run a function and I’m looking for an example. I’m on python 3.10.11 and vtk 9.3.0. Any snippets or examples would be greatly appreciated.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 30, 2024, 2:01am UTC](https://discourse.vtk.org/t/observer-timer-event-examples/13176/2 "2024-01-30T02:01:15Z")

</div>

Hello @cam

Yes, you can do this in python using VTK interactors. I understand you want a Python example, but this should help you. Here is a C++ example - [https://examples.vtk.org/site/Cxx/Utilities/Timer/](https://examples.vtk.org/site/Cxx/Utilities/Timer/) that shows how to create a timer callback function that observes timer events. You can easily convert that observer portion from C++ to python by following this guide - [https://examples.vtk.org/site/Python/Interaction/CallBack/#python](https://examples.vtk.org/site/Python/Interaction/CallBack/#python)
