MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / write_bytes

Method write_bytes

tools/python-3.11.9-amd64/Lib/pathlib.py:1061–1068  ·  view source on GitHub ↗

Open the file in bytes mode, write to it, and close the file.

(self, data)

Source from the content-addressed store, hash-verified

1059 return f.read()
1060
1061 def write_bytes(self, data):
1062 """
1063 Open the file in bytes mode, write to it, and close the file.
1064 """
1065 # type-check for the buffer interface before truncating the file
1066 view = memoryview(data)
1067 with self.open(mode='wb') as f:
1068 return f.write(view)
1069
1070 def write_text(self, data, encoding=None, errors=None, newline=None):
1071 """

Callers 1

Calls 2

openMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected