MCPcopy Create free account
hub / github.com/e2b-dev/desktop / write

Method write

packages/python-sdk/e2b_desktop/main.py:458–474  ·  view source on GitHub ↗

Write the given text at the current cursor position. :param text: The text to write. :param chunk_size: The size of each chunk of text to write. :param delay_in_ms: The delay between each chunk of text.

(self, text: str, *, chunk_size: int = 25, delay_in_ms: int = 75)

Source from the content-addressed store, hash-verified

456 raise RuntimeError(f"Invalid screen size format: {_match.group(1)}") from e
457
458 def write(self, text: str, *, chunk_size: int = 25, delay_in_ms: int = 75) -> None:
459 """
460 Write the given text at the current cursor position.
461
462 :param text: The text to write.
463 :param chunk_size: The size of each chunk of text to write.
464 :param delay_in_ms: The delay between each chunk of text.
465 """
466
467 def break_into_chunks(text: str, n: int):
468 for i in range(0, len(text), n):
469 yield text[i : i + n]
470
471 for chunk in break_into_chunks(text, chunk_size):
472 self.commands.run(
473 f"xdotool type --delay {delay_in_ms} -- {quote_string(chunk)}"
474 )
475
476 def press(self, key: Union[str, list[str]]):
477 """

Callers 2

mainFunction · 0.45
test_writeFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_writeFunction · 0.36