Aug-30-2020, 10:16 AM
Hey! I Have Problem I Am Using Pyinstaller To Make Exe But There Is Problem That I Have Some Ui files(because i am using pyqt5)
and i want to implement that if that files are not in folder that mainscript.py is then check it in Ui folder
Any Thoughts Plz?
Code I Thought:
and i want to implement that if that files are not in folder that mainscript.py is then check it in Ui folder
Any Thoughts Plz?
Code I Thought:
1 2 3 4 5 6 7 8 9 |
def resource_path(relative_path): """ Get absolute path to resource, works for dev and for PyInstaller """ try : # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath( "." ) return os.path.join(base_path, relative_path) |