Mayflower Bangalore India


Nothing here yet.


    py2c is a Python to C/C++ translator (converter). py2c translates Python to pure human-readable C/C++ like what you and me would write which does not have any Python API calls. The generated code can be run without Python installed and does not embed Python. For example:

    print("Hello World to py2c!")
    would be translated to

    #include "iostream"
    using namespace std; //If you want you can make py2c not add this and use std::cout instead of cout
    int main()
    cout<<"Hello World to py2c!\n";
    return 0;
    py2c is written in Python 3, but support for Python 2 will be added.

    Isn't this the same as Cython, Shedskin, RPython, ...?
    Many people have this misconception. py2c converts Python code to pure C/C++. Pure C/C++ is much faster than C/C++ riddled with Python API calls which just give 5x improvement. py2c is expected to give almost the same (at most 1.2x times slower) performance as C/C++

    I am the creator of py2c.