Skip to content

Instantly share code, notes, and snippets.

@mhipo1364
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhipo1364/02f9e8750d45f00587f6 to your computer and use it in GitHub Desktop.
Save mhipo1364/02f9e8750d45f00587f6 to your computer and use it in GitHub Desktop.
How to send parameters to method which is called by call_later in asyncio loop
from functools import partial
import datetime
function_handler = partial(show_time, data=2)
loop = asyncio.get_event_loop()
loop.call_later(30, function_handler)
def show_time(data):
print(datetime.now())
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment