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

Function open_picture

example_code/item_028.py:151–156  ·  view source on GitHub ↗
(profile_path)

Source from the content-addressed store, hash-verified

149 from collections import defaultdict
150
151 def open_picture(profile_path):
152 try:
153 return open(profile_path, "a+b")
154 except OSError:
155 print(f"Failed to open path {profile_path}")
156 raise
157
158 pictures = defaultdict(open_picture)
159 handle = pictures[path]

Callers 1

__missing__Method · 0.85

Calls 1

openFunction · 0.85

Tested by

no test coverage detected