11 lines
236 B
Python
11 lines
236 B
Python
import os
|
|
import sys
|
|
|
|
|
|
def resource_path(relative_path: str) -> str:
|
|
if hasattr(sys, '_MEIPASS'):
|
|
base_path = sys._MEIPASS
|
|
else:
|
|
base_path = os.path.abspath(".")
|
|
return os.path.join(base_path, relative_path)
|