Open manfeel opened 3 years ago
modify py.cpp
bool pyInit(PLUG_INITSTRUCT* initStruct) { // ... // Add 'plugins' (current directory) to sys.path GetCurrentDirectoryW(_countof(dir), dir); if(dir[wcslen(dir) - 1] != L'\\') wcsncat_s(dir, L"\\", _TRUNCATE); wcsncat_s(dir, token_paste(L, module_name), _TRUNCATE); GetShortPathNameW(dir, dir, _countof(dir)); _plugin_logputs(Utf16ToUtf8(dir).c_str()); PyList_Insert(PySys_GetObject("path"), 0, PyString_FromString(Utf16ToUtf8(dir).c_str())); // Append current script directory to sys.path for local importing PyList_Append(PySys_GetObject("path"), PyString_FromString(".")); }
modify py.cpp