Re: C Python extension to export an Function

2016-09-08 Thread Lawrence D’Oliveiro
On Friday, September 2, 2016 at 3:59:21 AM UTC+12, Stefan Behnel wrote: > Manually written C-API code is simply too difficult to maintain, and also > too difficult to get right in the first place. There are just too many ways > to introduce reference leaks, crashes and long standing unnoticed bugs

Re: C Python extension to export an Function

2016-09-01 Thread dieter
Ganesh Pal writes: > ... > Thanks stefan and Gollwitzer , good to know there are many ways to do this > i.e via cython or SWIG but the C/Python API > is probably the most widely used method > - not for it’s simplicity but for the fact that you can manipulate

Re: C Python extension to export an Function

2016-09-01 Thread Christian Gollwitzer
Hi Ganesh, Am 01.09.16 um 17:24 schrieb Ganesh Pal: Thanks stefan and Gollwitzer , good to know there are many ways to do this i.e via cython or SWIG but the C/Python API is probably the most widely used method - not for it’s simplicity but for the fact th

Re: C Python extension to export an Function

2016-09-01 Thread Pavel S
If you're familiar with C++, I recommend to have a look at Boost::Python. Sample program: #include #include void world() { std::cout << "hello world" << std::endl; } BOOST_PYTHON_MODULE( hello ) { using namespace ::boost::python; def( "world", &world ); } Usage: python -c "i

Re: C Python extension to export an Function

2016-09-01 Thread Stefan Behnel
Ganesh Pal schrieb am 01.09.2016 um 17:24: > Thanks stefan and Gollwitzer , good to know there are many ways to do this > i.e via cython or SWIG but the C/Python API > is probably the most widely used method It certainly was, years ago, but I honestly doubt

Re: C Python extension to export an Function

2016-09-01 Thread Ganesh Pal
Thanks stefan and Gollwitzer , good to know there are many ways to do this i.e via cython or SWIG but the C/Python API is probably the most widely used method - not for it’s simplicity but for the fact that you can manipulate python objects in your C code. I

Re: C Python extension to export an Function

2016-09-01 Thread Christian Gollwitzer
Am 01.09.16 um 14:30 schrieb Ganesh Pal: On Thu, Sep 1, 2016 at 12:32 PM, dieter wrote: Ganesh Pal writes: Iam pretty new to C Python extension , I was able to export few simple modules to python and it look like the cool thing to do ... Maybe, it is a good idea to have a look at "cython"

Re: C Python extension to export an Function

2016-09-01 Thread Stefan Behnel
Ganesh Pal schrieb am 01.09.2016 um 14:30: > On Thu, Sep 1, 2016 at 12:32 PM, dieter wrote: >> Ganesh Pal writes: >>> Iam pretty new to C Python extension , I was able to export few simple >>> modules to python and it look like the cool thing to do ... >> >> Maybe, it is a good idea to have a look

Re: C Python extension to export an Function

2016-09-01 Thread Ganesh Pal
On Thu, Sep 1, 2016 at 12:32 PM, dieter wrote: > Ganesh Pal writes: > > > Iam pretty new to C Python extension , I was able to export few simple > > modules to python and it look like the cool thing to do ... > > Maybe, it is a good idea to have a look at "cython". > > "cython" is a compiler. It

Re: C Python extension to export an Function

2016-09-01 Thread dieter
Ganesh Pal writes: > Iam pretty new to C Python extension , I was able to export few simple > modules to python and it look like the cool thing to do ... Maybe, it is a good idea to have a look at "cython". "cython" is a compiler. It translates Python code enhanced with special annotations into

C Python extension to export an Function

2016-08-31 Thread Ganesh Pal
Hi Team, Iam on python 2.7 and Linux. Iam pretty new to C Python extension , I was able to export few simple modules to python and it look like the cool thing to do , but Iam stuck for with a problem now , Iam not able to figure out how to export fun_addr_from_addr() to Python. I would need s