MCPcopy Create free account
hub / github.com/openai/openai-agents-python / open_file

Function open_file

examples/tools/image_generator.py:20–28  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

18
19
20def open_file(path: str) -> None:
21 if sys.platform.startswith("darwin"):
22 subprocess.run(["open", path], check=False) # macOS
23 elif os.name == "nt": # Windows
24 os.startfile(path) # type: ignore
25 elif os.name == "posix":
26 subprocess.run(["xdg-open", path], check=False) # Linux/Unix
27 else:
28 print(f"Don't know how to open files on this platform: {sys.platform}")
29
30
31async def main():

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected