I have a Python code and, after running all the stuff in it, I want it to simply run a c++ file I have in the same directory. I read about Cython and BoostPython, but I don't think it is what I need (I could be wrong, obviously). I don't want to call functions, simply run the c++ algorithm. Is there an easy way to do it?
-
Do you need to share data between python and the c++ program?snek_case– snek_case2020-01-20 18:43:34 +00:00Commented Jan 20, 2020 at 18:43
-
2when you say "c++ file" do you mean a source file or an executable?463035818_is_not_an_ai– 463035818_is_not_an_ai2020-01-20 18:53:23 +00:00Commented Jan 20, 2020 at 18:53
-
no, @snek_case, I just want to run the c++ program.donut– donut2020-01-20 18:59:04 +00:00Commented Jan 20, 2020 at 18:59
-
@formerlyknownas_463035818 the source file.donut– donut2020-01-20 18:59:18 +00:00Commented Jan 20, 2020 at 18:59
-
1You will need to compile (translate) the Source C++ file into an executable before you can run it. You can have Python run a compiler and specify your program (along with other command line parameters), then have Python run the executable program. An alternative is to find or create an interpreter for C++.Thomas Matthews– Thomas Matthews2020-01-20 19:27:33 +00:00Commented Jan 20, 2020 at 19:27
|
Show 1 more comment