Python Forum
code keeps running if i use from threading import timer?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code keeps running if i use from threading import timer?
#3
(Jan-25-2019, 04:26 AM)stullis Wrote: To halt execution of the main thread while the timer is running, call the Timer.join() method. This forces the calling thread to wait for the Timer to complete.

As for the cancel operation, I'm thinking that you'll need a second thread. The second thread would call a function requesting input. If input is given, it cancels the countdelay() thread; if no input is given and the countdelay thread is completed, the thread terminates.

Thank you for your reply. How do I create a new threat? This is my first time dealing with multiple threads
Reply


Messages In This Thread
RE: code keeps running if i use from threading import timer? - by birddseedd - Jan-25-2019, 04:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 669 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 397 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  the order of running code in a decorator function akbarza 2 536 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Error on import: SyntaxError: source code string cannot contain null bytes kirkwilliams2049 7 6,875 Aug-03-2023, 06:00 PM
Last Post: Gribouillis
  Concurrent futures threading running at same speed as non-threading billykid999 13 1,868 May-03-2023, 08:22 AM
Last Post: billykid999
  Why is this import running twice? extan1 10 2,851 Feb-17-2023, 02:02 AM
Last Post: extan1
  using threading.Timer for function korenron 1 1,209 Dec-20-2022, 01:09 PM
Last Post: ndc85430
  Code running many times nad not just one? korenron 4 1,377 Jul-24-2022, 08:12 AM
Last Post: korenron
  Error while running code on VSC maiya 4 3,777 Jul-01-2022, 02:51 PM
Last Post: maiya
  code running for more than an hour now, yet didn't get any result, what should I do? aiden 2 1,516 Apr-06-2022, 03:41 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020