14 lines
272 B
Python
14 lines
272 B
Python
import os.path
|
|
import sys
|
|
|
|
|
|
def get_base_dir():
|
|
if getattr(sys, 'frozen', None):
|
|
return sys._MEIPASS
|
|
else:
|
|
return os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
def get_file(file: str):
|
|
return os.path.normpath(os.path.join(get_base_dir(), file))
|