Answers for "pyinstaller onefile current working directory"

0

pyinstaller onefile current working directory

import os, sys
# determine if the application is a frozen `.exe` (e.g. pyinstaller --onefile) 
if getattr(sys, 'frozen', False):
    application_path = os.path.dirname(sys.executable)
# or a script file (e.g. `.py` / `.pyw`)
elif __file__:
    application_path = os.path.dirname(__file__)
config_name = 'myConfig.cfg'
config_path = os.path.join(application_path, config_name)
Posted by: Guest on June-16-2020

Code answers related to "pyinstaller onefile current working directory"

Python Answers by Framework

Browse Popular Code Answers by Language