MCPcopy Create free account
hub / github.com/python-websockets/websockets / print_during_input

Function print_during_input

src/websockets/cli.py:20–37  ·  view source on GitHub ↗
(string: str)

Source from the content-addressed store, hash-verified

18
19
20def print_during_input(string: str) -> None:
21 sys.stdout.write(
22 # Save cursor position
23 "\N{ESC}7"
24 # Add a new line
25 "\N{LINE FEED}"
26 # Move cursor up
27 "\N{ESC}[A"
28 # Insert blank line, scroll last line down
29 "\N{ESC}[L"
30 # Print string in the inserted blank line
31 f"{string}\N{LINE FEED}"
32 # Restore cursor position
33 "\N{ESC}8"
34 # Move cursor down
35 "\N{ESC}[B"
36 )
37 sys.stdout.flush()
38
39
40def print_over_input(string: str) -> None:

Callers 1

print_incoming_messagesFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…