MCPcopy Create free account
hub / github.com/Eve-PySpy/PySpy / resource_path

Function resource_path

config.py:27–35  ·  view source on GitHub ↗

Get absolute path to resource, works for dev and for PyInstaller

(relative_path)

Source from the content-addressed store, hash-verified

25
26# Location of packaged resource files when running pyinstaller --onefile
27def resource_path(relative_path):
28 """ Get absolute path to resource, works for dev and for PyInstaller """
29 try:
30 # PyInstaller creates a temp folder and stores path in _MEIPASS
31 base_path = sys._MEIPASS
32 except Exception:
33 base_path = os.path.dirname(__file__)
34
35 return os.path.join(base_path, relative_path)
36
37
38# If application is frozen executable

Callers 1

config.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected