"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > Say because of performance, you might want to re-write/convert > Python code to C++. What is the best way (or best practice) > to do this wrt the tools available?
It may be obvious but its worth noting that optimised Python may be faster than a badly written C port. So first make sure you have squeezed the best performance out of Python. Secondly only rewrite the bits that need it so use the profiler to identify the bottlenecks in your Python code and move those to a separate module to reduce conversion effort. After that the advice already given re pyrex/psycho etc is all good. You might also find SWIG a useful alternative if you decide to rewrite the slow functions by hand. SWIG will help wrap those functions so that the remaining Python code can access them. Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor