-
Notifications
You must be signed in to change notification settings - Fork 748
Open
Description
Consider the following:
import asyncio
from prompt_toolkit.shortcuts import prompt_async
async def spam():
while True:
print("hello");
await asyncio.sleep(0.1);
print("World");
await asyncio.sleep(0.1);
async def my_coroutine():
while True:
result = await prompt_async('Say something: ', patch_stdout=True)
print('You said: %s' % result)
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(my_coroutine(), spam()))
loop.close()
What I expect to happen: The prompt is pushed down by a continual stream of Hello
and World
What actually happens: Each time I push a single character, an extra Hello
or World
is printed - the output does not advance while waiting for a single character.
Metadata
Metadata
Assignees
Labels
No labels