How to stop a scheduler stated using

N

Nagendra Kumar

Hello ALL,

I am trying to schdule some of my class methods using sched module of
python

import sched, time
s=sched.scheduler(time.time, time.sleep)

event1=s.enter(60, 1, obj.scheduleAbuseAssignment1, ())
event2=s.enter(60, 1, obj.scheduleAbuseAssignment2, ())
event3=s.enter(60, obj.scheduleAbuseAssignment3, ())

Is there any way to stop these scheduled events?If so, can we do it
through a UI

Thanks in advance.

Regards,
- Nagendra Kumar
 
G

Gabriel Genellina

import sched, time
s=sched.scheduler(time.time, time.sleep)

event1=s.enter(60, 1, obj.scheduleAbuseAssignment1, ())
event2=s.enter(60, 1, obj.scheduleAbuseAssignment2, ())
event3=s.enter(60, obj.scheduleAbuseAssignment3, ())

Is there any way to stop these scheduled events?If so, can we do it
through a UI

Using s.cancel(event1). The UI is up to you...
See http://docs.python.org/lib/scheduler-objects.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top