MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / lengths_path

Function lengths_path

example_code/item_089.py:121–128  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

119 f.write("\n")
120
121def lengths_path(path):
122 try:
123 with open(path) as handle:
124 for i, line in enumerate(handle):
125 print(f"Line {i}")
126 yield len(line.strip())
127 finally:
128 print("Finally lengths_path")
129
130
131print("Example 9")

Callers 1

item_089.pyFile · 0.85

Calls 1

openFunction · 0.85

Tested by

no test coverage detected