0
Can I program in Python and use a code made in C ++? Could I see some example?
So it was with the C language and the assembly language. It was more efficient to program in C language, but if it was necessary to optimize some part, it was reprogrammed in the assembly language.
3 Réponses
+ 4
This page includes a simple example:
https://docs.python.org/3/extending/extending.html
"The library contains built-in modules (written in C)": https://docs.python.org/3/library/index.html
+ 2
@jorge Grave is absolutely right, you can make most of your program with python and only optimize a small part ( let's say a single function that will manage a heavier process, or you need speed improvement) and then back to python
hope it helps you
+ 1
Yes, you can. It is very common to happen in industry. One example is to use Python to create graphics and interface, read input and store it in a file. Then, call a C++ program to make a heavy processing in the file (for example, finding shortest path between two points) and create a result file. The result file is then read by the first python program that prints the output graphically in the UI.