-
Notifications
You must be signed in to change notification settings - Fork 966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass in day name #574
Comments
You methods seems will introduce duplicated jobs after 1 month. |
i'm running into the same thing. without patching the library specifically, you can do something somewhat hacky like the following: e = schedule.every()
e.start_day = day_name
e.unit = "weeks"
e.at(go_time).do(job) the day of week properties are setting |
@jamesgeddes I use the following solution: For your case, replace the "seconds" with the user input. You can also first check whether the user input is actually valid by checking if it exists in in the Job class, i.e.: Well and of course don't forget to .lower() the user input first. |
Firstly, thanks for writing schedule! It is fantastic and I have used it a tonne.
I am getting user input to ascertain which days the program should execute. Though I never normally trust a user, for the sake of simplicity here, we shall assume that the user is infallible.
The docs show that one can specify days to run a function on as follows.
Unfortunately, I cannot see a way to pass a day name or value into schedule. As such, I am currently running a "check day" job every day.
This seems a bit inefficient, particularly when there is nothing to do for several days.
TL;DR
It would be great to be able to pass in a day name or number as a variable.
The text was updated successfully, but these errors were encountered: