pyinstaller onefile current working directory

Solutions on MaxInterview for pyinstaller onefile current working directory by the best coders in the world

showing results for - "pyinstaller onefile current working directory"
Lisa
26 Jan 2017
1import os, sys
2# determine if the application is a frozen `.exe` (e.g. pyinstaller --onefile) 
3if getattr(sys, 'frozen', False):
4    application_path = os.path.dirname(sys.executable)
5# or a script file (e.g. `.py` / `.pyw`)
6elif __file__:
7    application_path = os.path.dirname(__file__)
8config_name = 'myConfig.cfg'
9config_path = os.path.join(application_path, config_name)