We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd02687 commit 045e2b2Copy full SHA for 045e2b2
examples/telnet/hello-world.py
@@ -10,7 +10,7 @@
10
11
from prompt_toolkit.contrib.telnet.server import TelnetServer
12
from prompt_toolkit.eventloop import get_event_loop
13
-from prompt_toolkit.shortcuts import clear, prompt
+from prompt_toolkit.shortcuts import PromptSession, clear
14
15
# Set up logging
16
logging.basicConfig()
@@ -22,7 +22,8 @@ async def interact(connection):
22
connection.send("Welcome!\n")
23
24
# Ask for input.
25
- result = await prompt(message="Say something: ", async_=True)
+ session = PromptSession()
26
+ result = await session.prompt_async(message="Say something: ")
27
28
# Send output.
29
connection.send(f"You said: {result}\n")
0 commit comments