I am trying to run a python program from my GUI in JUCE.
I tried using system(“python program_name.py”)
but it didnt work.
I also tried returning the current directory using File::getCurrentWorkingDirectory().getFullPathName()
then combining it with my python program path. It still didnt work.
AFAIK, the best way to do this in JUCE would be to use
I hope this helps!
Thank You so much , Yeah this seems much more simpler then running through system()
ChildProcess is good if you want to keep track of execution. If you simply want to start a program, there is also file.startAsProcess() and file.revealToUser() to open an application.
startAsProcess() is very handy, because it will call the installed viewer, if called on a document file (e.g. foo.pdf would open Preview on OSX and acrobat reader on windows (or whichever pdf viewer is installed).
??? I thought this just opened a Finder/Explorer window showing the file or folder.
Daniel had a typo probably… Bet he was speaking of;
Launches the file as a process.
if the file is executable, this will run it.
if it's a document of some kind, it will launch the document with its default viewer application.
if it's a folder, it will be opened in Explorer, Finder, or equivalent.