MCPcopy
hub / github.com/StevenBlack/hosts / write_data

Function write_data

updateHostsFile.py:1729–1741  ·  view source on GitHub ↗

Write data to a file object. Parameters ---------- f : file The file object at which to write the data. data : str The data to write to the file.

(f, data)

Source from the content-addressed store, hash-verified

1727
1728
1729def write_data(f, data):
1730 """
1731 Write data to a file object.
1732
1733 Parameters
1734 ----------
1735 f : file
1736 The file object at which to write the data.
1737 data : str
1738 The data to write to the file.
1739 """
1740
1741 f.write(bytes(data, "UTF-8"))
1742
1743
1744def list_dir_no_hidden(path):

Callers 8

test_write_basicMethod · 0.90
test_write_unicodeMethod · 0.90
update_all_sourcesFunction · 0.85
create_initial_fileFunction · 0.85
compress_fileFunction · 0.85
minimise_fileFunction · 0.85
remove_dups_and_exclFunction · 0.85
write_opening_headerFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_write_basicMethod · 0.72
test_write_unicodeMethod · 0.72