MCPcopy Index your code
hub / github.com/microsoft/playwright-python / async_writefile

Function async_writefile

playwright/_impl/_helper.py:528–534  ·  view source on GitHub ↗
(file: Union[str, Path], data: Union[str, bytes])

Source from the content-addressed store, hash-verified

526
527
528async def async_writefile(file: Union[str, Path], data: Union[str, bytes]) -> None:
529 def inner() -> None:
530 with open(file, "w" if isinstance(data, str) else "wb") as fh:
531 fh.write(data)
532
533 loop = asyncio.get_running_loop()
534 await loop.run_in_executor(None, inner)
535
536
537async def async_readfile(file: Union[str, Path]) -> bytes:

Callers 5

screenshotMethod · 0.90
storage_stateMethod · 0.90
storage_stateMethod · 0.90
screenshotMethod · 0.90
pdfMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected