<div dir="ltr">I dont know why, but pdytools_init_executable_dir called before python interpreter properly initialized(or during its initialization). So moving this call before PySetProgramName and PyInitialize, and removing from pdytools_init_executable_dir calls of Py* fucntions and setting excutable dir in w_argv[0] makes program to work properly.</div>