Skip to content
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

Updated README Usage to work with function argument #519

Merged
merged 4 commits into from
Apr 10, 2022
Merged

Updated README Usage to work with function argument #519

merged 4 commits into from
Apr 10, 2022

Conversation

rudSarkar
Copy link
Contributor

This PR is about a few changes on the README file, where I added demo usages because people mostly find and wanted to work with function arguments instantly. I created this PR because there are more lazy people like me who will find it useful.

Another example given below is to work with multiple arguments.

import schedule
import time

def job():
    print("I'm working...")

""" working with multiple argument """
def function_job(name, age):
    print(f"I am {name} and my age is: {age}")

schedule.every(10).seconds.do(job)
schedule.every(10).seconds.do(function_job, name="Peter Griffin", age=22)
    
while True:
    schedule.run_pending()
    time.sleep(1)

Thanks,
@rudSarkar

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Collaborator

@SijmenHuizenga SijmenHuizenga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I like that this makes it easier for people to get started.

Just a few small suggestions to tidy it up.

README.rst Outdated
def function_job(name):
print(f"I am {name}")
schedule.every(10).seconds.do(job, name="Peter Griffin")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
schedule.every(10).seconds.do(job, name="Peter Griffin")
schedule.every(10).seconds.do(job, name="Peter")

Let's keep the readme clean of cultural references 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SijmenHuizenga sorry for this but the function name here need to be changed schedule.every(10).seconds.do(job, name="Peter") to schedule.every(10).seconds.do(function_job, name="Peter")

rudSarkar and others added 3 commits April 10, 2022 21:56

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Sijmen <sijmenhuizenga@gmail.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Sijmen <sijmenhuizenga@gmail.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Sijmen <sijmenhuizenga@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.699% when pulling da68c3f on rudSarkar:patch-1 into ed7d219 on dbader:master.

@SijmenHuizenga SijmenHuizenga merged commit 64f8398 into dbader:master Apr 10, 2022
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.

None yet

3 participants