
Originally Posted by
roidayan
if i run the script from python shell before making it sis
it will create/read the config from the same dir as the script file ?
No. It will go into the directory the PythonScriptShell was installed to - something like E:\Private\2000b1a5.
If you want to save to the directory where the currently running script is located, then try...
Code:
import sys, os
CONFIG_FILENAME = 'config.cfg'
try:
raise Exception
catch Exception:
filepath = sys.exc_info()[2].tb_frame.f_code.co_filename
filedir, filename = os.path.split(filepath)
configfile = os.path.join(filedir, CONFIG_FILENAME)
f = open(configfile, 'w')
# etc.