Python Forum

Full Version: Timers In python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Everyone,

I am new to python,and wanted to Implement the Timer concept In python. I tried with threading module but don't know how to stop the Thread. And I am using only one thread very small piece of code but even after the parent process is closed the child process is running in the background.

Is there any other Implementation of Timer without using Thread module? Any help would be appreciated.

Thank you,
Shruthi LS
Use multiprocessing module - it has the same API as the threading module, so that the switch will be painless. And a parent process can kill the spawned one
A multiprocessing Process can be terminated https://pymotw.com/3/multiprocessing/bas...-processes
Ok thanks for the reply. But I don't have access for the event of closing the thread. Will the multiprocessing works in that way....