i have prepared a project in python language ie a TEXT TO SPEECH synthesizer. Which took a total on 1500 lines of code.
But there few parts of code due to which it is taking so much time to run the code, i want to replace that parts of code in C/c++ lang so that it runs faster.
So i want to know how can i run these parts of code in C++ or improve its speed in any other way??
please suggest,
You have a few options:
As Radomir mentioned, Cython might be a good choice: it's essentially a restricted Python with type declarations, automatically translated into C then compiled for execution.
If you want to use pure C, you can write a Python extension module using the Python C API.  This is a good way to go if you need to manipulate Python data structures in your C code.  Using the Python C API, you write in C, but with full access to the Python types and methods.
Or, you can write a pure C dll, then invoke it with ctypes.  This is a good choice if you don't need any access to Python data structures in your C code.  With this technique, your C code only deals with C types, and your Python code has to understand how to use ctypes to get at that C data.
how to replicate parts of code in python into C to execution faster?