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)