I have all my .cpp and .hpp files and I need to generate an .exe file from them (so my program works on Windows) with a compile.py file.
I need to code the compile.py file.
How should I do that please?
Already took a look at py2exe and PyInstaller, but I believe this is for python files only, not C++ files. Thanks
1 Answer 1
You need a C++ compiler, not a compile.py file. If you REALLY need to use Python, use either subprocess (better) or os.system to call command line commands:
import subprocess
subprocess.run('your C++ compiler command')
import os
os.system('compiler command')
But it would be much simpler to do it from the command line, directly executing the compile command.
Comments
Explore related questions
See similar questions with these tags.
compile.py, you need a compilation toolchain.