MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / setup

Function setup

example_code/item_077.py:137–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135 handle.close()
136
137def setup():
138 tmpdir = TemporaryDirectory()
139 input_paths = start_write_threads(tmpdir.name, 5)
140
141 handles = []
142 for path in input_paths:
143 handle = open(path, "rb")
144 handles.append(handle)
145
146 Thread(target=close_all, args=(handles,)).start()
147
148 output_path = os.path.join(tmpdir.name, "merged")
149 return tmpdir, input_paths, handles, output_path
150
151
152print("Example 5")

Callers 1

item_077.pyFile · 0.70

Calls 3

openFunction · 0.85
start_write_threadsFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected