Currently the electron application has a python executable to run. The executable will create two folders to save the output data. These two folders are being created at the root folder where the python executable is placed in another folder. So how could we change the path of the python executable output inside an electron application.
const getBinaries = () => {
let appPath = null;
if (
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
) {
appPath = path.join('app');
} else {
appPath = path.join(app.getAppPath(), '..');
}
const binariesDir = path.join(appPath, 'binaries');
return binariesDir;
};
'binaries' is the directory where the python exe is placed. Once the python exe is executed, it will create two folders. One for images and another for files. But these two files are not created in the path of the python exe. Expected path of these folders are in the binaries but these folders are created in the root. The getBinaries() function gives the path inside of the app folder but the images are created in the root path.
Current folder structure
------------------------
app/binaries/pyhonexe
output-files
output-images
How to make electron application to run python exe to create these output-files and output-images directories inside the binaries folder which is the same folder of the python exe. Currently it creates outside this app folder. In the root location.