Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pyinstaller #onefile #current #working #directory
ADD COMMENT
Topic
Name
6+9 =