'Add external exe file with pyinstaller

I have a python program that uses multiple files including an .exe program called with subprocess.run(myprogram.exe).

When I build the new .exe with pyinstaller and try to execute the program, it cannot find myprogram.exe.

I'm using the following statment:

pyinstaller -w -F --onefile .\MyPythonProgram.py

myprogram.exe is in the same folder as MyPythonProgram.py. Should I change anything for it to add it to the .exe?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source