Skip to content

Conversation

@VictorioMaculan
Copy link

So, I created this exciting method, job().change_func(), because I think it would be cool to allow the users to change the job's function in a more implicit way, and, it also helps to keep the function metadata. Take a look:

def hello(name):
    print(f'Hello, {name}!')

sch = schedule.every().second.do(hello, 'folks')

while True:
    if timer >= 10:
        sch.change_func(hello, 'friends') # Right here
        
    schedule.run_pending()

But what do you guys think? Sorry for anything, it's my first time contributing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant