I created a python file called leaderboard and made it into a .exe file using pyinstaller. This .exe file is in a folder called dist which is inside the data folder for my sketch. I first attempted to launch the file using the launch() function and while this gave me no errors it did not execute the file.
launch("data/dist/leaderboard.exe");
For my next attempt, I tried using the exec function instead.
exec("data/dist/leaderboard.exe");
This gave me the error code: Exception while attempting data/dist/leaderboard.exe
Next, I decided to use the full file path while using the launch function.
launch("C:/Users/Tahseen/Documents/cs corsework 2/Bloodlust/data/dist/leaderboard.exe");
This caused repeated popups with the title "fatal error detected" and the caption "unable to execute script leaderboard". Using exec() gave me this result too.
After researching I've found one solution that works for a few people is to use a double \ instead of a single / however this did nothing for me.
I confirmed that the file executes properly when opened manually from within the folder so I think the issue lies somewhere within my code.
UPDATE: I think that in the first two cases the file leaderboard.exe could not be located however I don't know why as when I put a random string inside the brackets the same thing happened. This lead me onto a second question: is there a way to execute a file from within the project folder i.e without the entire file path?