From 31dd18fd973947adf21eb129955e33599b6617c4 Mon Sep 17 00:00:00 2001 From: Agnes Date: Sat, 6 Mar 2021 21:53:04 +0100 Subject: Make curses async --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 51ab636..5336d05 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,12 @@ import cursed +import asyncio -def on_str(s): +async def on_str(s): print(s) -def on_tab(): - print("Nu tryckte nån på tab") -cursed.start(on_str, on_tab) +async def on_tab(): + print("tab") + + +asyncio.new_event_loop().run_until_complete(cursed.start(on_str, on_tab)) -- cgit v1.2.1