I recently started learning C++ because I wanted to use it in conjunction with Python so I could have the best of both worlds. I have gotten the basics of C++ over the past week or so, and I want to start incorporating it into my Python projects and vice versa. The problem is that I don't know what the best way to do this would be. The first thing that came to mind was making a Python script into an exe and calling it from the C++ program so I could extract the output. This solution sounds like it would work but I feel like there could be a better way of going about it. I know this isn't as much of a coding question as it is a logistics question so I apologize for being a bit off topic.
Asked
Active
Viewed 179 times
0
-
1It depends on what exactly you are trying to do, but using something like pybind11 allows you to "connect" the two languages a lot simpler: https://pybind11.readthedocs.io/en/stable/ – UnholySheep Apr 22 '20 at 16:33
-
1Generally they write the backend processing in C++ and use python for the front end linking of calls, http://wolfprojects.altervista.org/articles/dll-in-c-for-python/, it's certaintly not a new question... https://stackoverflow.com/questions/1076300/extending-python-with-c-c, – tgikal Apr 22 '20 at 16:35
-
Thanks I will check those out! – Jackal Apr 22 '20 at 16:38