You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from prompt_toolkit import prompt
def main():
text = prompt('> ')
print('You entered:', text)
if __name__ == '__main__':
main()
How would I answer the prompt programmatically from a different thread or asyncio task?
I digged up a bit and it looks like under the hood prompt calls asyncio.run(coro) where coro is an internal coroutine that reacts to key pressure in the terminal.
There is a way to get that coroutine and maybe stop it or change its status?
Or maybe some trick to fake keyboard pressure?
Thanks!
The text was updated successfully, but these errors were encountered:
Hello and thanks for this cool library!
Given this example
How would I answer the prompt programmatically from a different thread or asyncio task?
I digged up a bit and it looks like under the hood
prompt
callsasyncio.run(coro)
wherecoro
is an internalcoroutine
that reacts to key pressure in the terminal.There is a way to get that coroutine and maybe stop it or change its status?
Or maybe some trick to fake keyboard pressure?
Thanks!
The text was updated successfully, but these errors were encountered: