Last active
August 29, 2015 14:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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