Re: Embedded Python and C Callback functions

2015-06-07 Thread dieter
doc.mefi...@gmail.com writes: > I'm trying to debug and find my error. It goes wrong when: > PyObject *v; > v = va_arg(*p_va, PyObject *); > if (v != NULL) { > if (*(*p_format - 1) != 'N') > Py_INCREF(v); > } > > it tries to

Re: Embedded Python and C Callback functions

2015-06-07 Thread Stefan Behnel
doc.mefi...@gmail.com schrieb am 07.06.2015 um 10:56: > And I can't use Cython, because I have C++ module, and I have to use it. That's not a valid reason. Cython supports C++ code just fine. http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html Stefan -- https://mail.python.org/mailma

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
> >And I can't use Cython, because I have C++ module, and I have to use it. > >-- > >https://mail.python.org/mailman/listinfo/python-list > > Are you using Boost? > http://www.boost.org/doc/libs/1_58_0/libs/python/doc/ > > It handles lots of the setup for you. > > Laura No, I'm not using Boost

Re: Embedded Python and C Callback functions

2015-06-07 Thread Laura Creighton
In a message of Sun, 07 Jun 2015 01:56:47 -0700, doc.mefi...@gmail.com writes: >And I can't use Cython, because I have C++ module, and I have to use it. >-- >https://mail.python.org/mailman/listinfo/python-list Are you using Boost? http://www.boost.org/doc/libs/1_58_0/libs/python/doc/ It handles

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
I'm trying to debug and find my error. It goes wrong when: PyObject *v; v = va_arg(*p_va, PyObject *); if (v != NULL) { if (*(*p_format - 1) != 'N') Py_INCREF(v); } it tries to PyINCREF to my passed callback. -- https://mail

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
And I can't use Cython, because I have C++ module, and I have to use it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python and C Callback functions

2015-06-07 Thread doc . mefisto
No, myclass is not null. I think my style of passing arguments is wrong. -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python and C Callback functions

2015-06-06 Thread dieter
doc.mefi...@gmail.com writes: > Hi. I'm a newbie in python. But I want embed it in my C program. > > There is such method of my class: > @staticmethod > def install_instr_callback(callback): > # set hook for every change of PC > m68k.set_instr_hook_callback(callback) > > And in my C code t

Embedded Python and C Callback functions

2015-06-06 Thread doc . mefisto
Hi. I'm a newbie in python. But I want embed it in my C program. There is such method of my class: @staticmethod def install_instr_callback(callback): # set hook for every change of PC m68k.set_instr_hook_callback(callback) And in my C code there is such callback function: static PyObject

Creating a binary only python distribution of a C extension module and including some additional python and c files in it

2012-01-01 Thread akhilesh singhania
Hi, I have a extension module in C which I want to distribute in binary format, ideally an rpm. Additionally, I want to include some python files (examples on how to use the extension module) and source for a library the module dynamically links to (c,h, and make files). How do I specify the exam

Creating a binary only python distribution of a C extension module and including some additional python and c files in it

2011-12-30 Thread akhilesh singhania
Hi, I have a extension module in C which I want to distribute in binary format, ideally an rpm. Additionally, I want to include some python files (examples on how to use the extension module) and source for a library the module dynamically links to (c,h, and make files). How do I specify the exam

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-22 Thread Neil Cerutti
On 2011-12-22, Roy Smith wrote: > In article , > Grant Edwards wrote: >> C++ is a vast, complex, and dangerous language -- and industry >> doesn't seem to be willing to limit itself to using the seven >> people on the planet who understand it. > >> I'm only half joking... :) > > Half joking, in

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Roy Smith
In article , Grant Edwards wrote: > C++ is a vast, complex, and dangerous language -- and industry > doesn't seem to be willing to limit itself to using the seven people > on the planet who understand it. > I'm only half joking... :) Half joking, indeed. I happen to know for a fact that th

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Ethan Furman
Grant Edwards wrote: On 2011-12-21, Neil Cerutti wrote: I cheerfully agree that programmers ignorant of C++ should not write programs in it. But furthermore, they should also not define a subset of C++ for use in embedded programming. ;) I fully agree that programmers ignorant of C++ should n

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Grant Edwards
On 2011-12-21, Neil Cerutti wrote: > On 2011-12-21, Grant Edwards wrote: >> Templates are how C++ does generics and I'd expect them to appear in be used in embedded programming as well as elsewhere. >> >> I've only worked on the perphery of a couple embedded projects that >> used C++, b

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Neil Cerutti
On 2011-12-21, Grant Edwards wrote: > On 2011-12-21, Neil Cerutti wrote: >> On 2011-12-20, Paul Rubin wrote: >>> Grant Edwards writes: Oops. I should have mentioned this is for embedded systems programming so templates in general (and STL in particular) are probably off the table

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Grant Edwards
On 2011-12-21, Neil Cerutti wrote: > On 2011-12-20, Paul Rubin wrote: >> Grant Edwards writes: >>> Oops. I should have mentioned this is for embedded systems >>> programming so templates in general (and STL in particular) >>> are probably off the table. >> >> Templates are how C++ does generics

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Roy Smith
In article <9le7c5f1l...@mid.individual.net>, Neil Cerutti wrote: > On 2011-12-20, Paul Rubin wrote: > > Grant Edwards writes: > >> Oops. I should have mentioned this is for embedded systems > >> programming so templates in general (and STL in particular) > >> are probably off the table. > > >

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Neil Cerutti
On 2011-12-20, Paul Rubin wrote: > Grant Edwards writes: >> Oops. I should have mentioned this is for embedded systems >> programming so templates in general (and STL in particular) >> are probably off the table. > > Templates are how C++ does generics and I'd expect them to > appear in be used i

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Paul Rubin
Grant Edwards writes: > Unfortunately, I had to muck about with the original library's code to > change a couple things from "private" to "protected" to allow me to > extend the class to do what needed to be done. Every time I have to > do anything with C++ (once every handfull of years) it feels

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Paul Rubin
Grant Edwards writes: > Oops. I should have mentioned this is for embedded systems programming > so templates in general (and STL in particular) are probably off the > table. Templates are how C++ does generics and I'd expect them to appear in be used in embedded programming as well as elsewhere.

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Grant Edwards
On 2011-12-20, Grant Edwards wrote: > Would anybody care to recommend online C++ resources for a long time C > and Python user? (I'm also familiar with Smalltalk, Scheme, FORTRAN, > bash, Javascript, and a variety of assembly languages.) > > I have a C++ library to which I need to add a couple m

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Grant Edwards
On 2011-12-20, Neil Cerutti wrote: > On 2011-12-20, Grant Edwards wrote: >> Would anybody care to recommend online C++ resources for a long >> time C and Python user? (I'm also familiar with Smalltalk, >> Scheme, FORTRAN, bash, Javascript, and a variety of assembly >> languages.) > > The best b

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Paul Rubin
Grant Edwards writes: > Would anybody care to recommend online C++ resources for a long time C > and Python user? (I'm also familiar with Smalltalk, Scheme, FORTRAN, > bash, Javascript, and a variety of assembly languages.) Stroustrup's web site has lots of good stuff on it. I also like his C++

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Neil Cerutti
On 2011-12-20, Grant Edwards wrote: > Would anybody care to recommend online C++ resources for a long > time C and Python user? (I'm also familiar with Smalltalk, > Scheme, FORTRAN, bash, Javascript, and a variety of assembly > languages.) The best book I know of to get you writing useful C++ qu

[OT] Quick intro to C++ for a Python and C user?

2011-12-20 Thread Grant Edwards
Would anybody care to recommend online C++ resources for a long time C and Python user? (I'm also familiar with Smalltalk, Scheme, FORTRAN, bash, Javascript, and a variety of assembly languages.) I have a C++ library to which I need to add a couple minor wrappers/extensions. I've already done the

Re: Socket connection between python and C

2011-02-09 Thread Stefan Behnel
Williamson, Ross X. wrote: I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. Is this a strict requirement? Could you give us a hint why the client needs to be plain C/C++? Stefan -- http://mail.python.org/mailman/

Re: Socket connection between python and C

2011-02-09 Thread Irmen de Jong
On 09-02-11 01:54, Williamson, Ross X. (Guest) wrote: Dear All, I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. I can happily send simple text through the socket. Ideally I would like make say a struct (using pyth

Re: Socket connection between python and C

2011-02-08 Thread Dan Stromberg
On Tue, Feb 8, 2011 at 5:41 PM, Roy Smith wrote: > In article , >  "Williamson, Ross X. (Guest)" >  wrote: > >> Dear All, >> >> I'm trying to implement a server/client system where the server is written in >> python and the client has to be written in c/c++.  I can happily send simple >> text thr

Re: Socket connection between python and C

2011-02-08 Thread Roy Smith
In article , "Williamson, Ross X. (Guest)" wrote: > Dear All, > > I'm trying to implement a server/client system where the server is written in > python and the client has to be written in c/c++. I can happily send simple > text through the socket. Ideally I would like make say a struct (u

Socket connection between python and C

2011-02-08 Thread Williamson, Ross X. (Guest)
Dear All, I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. I can happily send simple text through the socket. Ideally I would like make say a struct (using python struct library) - and then read that in using C. Is

Re: help req debugging python and c together

2010-04-19 Thread CHEN Guang
>Hi, >I am working in gnuradio compiler. I need some help in debugging python and c >together. >By this i mean that i have written some blocks in c that are connected >together using python. So i need to debug >( breakpoints ect ) python such that when a specific c block is ca

help req debugging python and c together

2010-04-18 Thread sanam singh
Hi, I am working in gnuradio compiler. I need some help in debugging python and c together. By this i mean that i have written some blocks in c that are connected together using python. So i need to debug( breakpoints ect ) python such that when a specific c block is called at the back end

Re: Bridging Python and C

2009-07-23 Thread Dave Angel
Mohan Parthasarathy wrote: Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org/doc/2.5.2/ext/intro.html What is the

Re: Bridging Python and C

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 5:45 PM, Mohan Parthasarathy wrote: Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org

Re: Bridging Python and C

2009-07-23 Thread Christian Heimes
Mohan Parthasarathy wrote: > Hi, > I am a newbie. It looks like there are quite a few ways to bridge Python and > C. I have a bunch of C code and I just need Python wrappers for it. If i > google for this I get SWIG, Boost etc. And I also see > > http://www.python.org/doc/2.

Bridging Python and C

2009-07-23 Thread Mohan Parthasarathy
Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org/doc/2.5.2/ext/intro.html What is the recommended way for doing

Re: Interfacing python and C

2009-03-28 Thread Nick Craig-Wood
MRAB wrote: > steve William wrote: > > Hi All, > > > > I'm using SWIG for the first time and I am facing some problems with > > user defined header files. I'm trying to use my own header file in a C > > program which would be interfaced with python. > > > > The header file is test.h: > > /#in

Re: Interfacing python and C

2009-03-27 Thread MRAB
steve William wrote: Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: /#include int fact(int n) { if (n <= 1) re

Interfacing python and C

2009-03-27 Thread steve William
Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: *#include int fact(int n) { if (n <= 1) return 1; else return n

Interfacing python and C

2009-03-27 Thread steve William
Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: *#include int fact(int n) { if (n <= 1) return 1; else return n

Re: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-28 Thread Eric von Horst
ll > (hopefully) compile. > > I'd focus on doing it manually, then getting distutils to work properly. > > -Original Message- > From: Hyuga [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 27, 2008 10:01 AM > To: [EMAIL PROTECTED] > Subject: Re: first time use

RE: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-27 Thread Bronner, Gregory
Message- From: Hyuga [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 10:01 AM To: python-list@python.org Subject: Re: first time use of swig, python and c++ .. it's a mess ... please advice On Feb 26, 3:38 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > &g

Re: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-27 Thread Hyuga
On Feb 26, 3:38 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > > we have a third-party product that has a C++ api on HP-UX. > > I would like be able to use the API in Python (as I remember Python is > good at doing this). > > I have no experience with this so I Googled and tried to find some

first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-26 Thread Eric von Horst
Hi, we have a third-party product that has a C++ api on HP-UX. I would like be able to use the API in Python (as I remember Python is good at doing this). I have no experience with this so I Googled and tried to find some info on what I had to do. So, I installed Python 2.4.4 and Swig 1.3.33 T

Re: web service between python and c#

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 07:24], abhishek ([EMAIL PROTECTED]) wrote: >but have no idea on how to interface it with c# client. Totally depends on what exactly you need to accomplish. Some solutions can just use SOAP or REST. Others need full-fledged XML-RPC or other similar solutions. Some just use a seriali

web service between python and c#

2008-01-07 Thread abhishek
Hello group i need to make a web service to work between python and c# . Where python would server as backend (server) preferebly cherrypy (turbogears) and client would be on a c# appln. I have developed a webservice using TGWebServices package which runs on top of turbogears. but have no idea

Re: Mixing Python and C classes in a module

2007-10-10 Thread John Machin
On 10/10/2007 1:02 PM, [EMAIL PROTECTED] wrote: > > It is easier to do it the other way around. > Create module.py and _module.so and in module.py write: > > from _module.so import * It is even easier to type from _module import * and somewhat more productive, too :-) -- http://mail.pyt

Re: Mixing Python and C classes in a module

2007-10-09 Thread timaranz
On Oct 10, 3:32 pm, "Nicholas Bastin" <[EMAIL PROTECTED]> wrote: > On 10/9/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > > > On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is it possible to mix cla

Re: Mixing Python and C classes in a module

2007-10-09 Thread Nicholas Bastin
On 10/9/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is it possible to mix classes defined in both Python and C in the same > > module? Ideally I would like to be able to do:

Re: Mixing Python and C classes in a module

2007-10-09 Thread John Machin
On 10/10/2007 12:56 AM, Stefan Arentz wrote: > Is it possible to mix classes defined in both Python and C in the same > module? Ideally I would like to be able to do: > > from some.module import MyPythonClass, MyCClass > > I guess that would mean that this would look

Re: Mixing Python and C classes in a module

2007-10-09 Thread Kay Schluehr
On Oct 9, 4:56 pm, Stefan Arentz <[EMAIL PROTECTED]> wrote: > Is it possible to mix classes defined in both Python and C in the same > module? Ideally I would like to be able to do: > > from some.module import MyPythonClass, MyCClass > > I guess that would mean that this

Re: Mixing Python and C classes in a module

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > Is it possible to mix classes defined in both Python and C in the same > module? Ideally I would like to be able to do: > > from some.module import MyPythonClass, MyCClass > > I guess that woul

Mixing Python and C classes in a module

2007-10-09 Thread Stefan Arentz
Is it possible to mix classes defined in both Python and C in the same module? Ideally I would like to be able to do: from some.module import MyPythonClass, MyCClass I guess that would mean that this would look like this on disk: some/ __init__.py module.py (contains MyPythonClass

Re: Mixing Python and C threads

2007-08-13 Thread Stéphane Larouche
Aahz pythoncraft.com> writes: > > In article python.org>, > =?utf-8?b?U3TDqXBoYW5l?= Larouche polymtl.ca> wrote: > >Aahz pythoncraft.com> writes: > >> > >> Can you reproduce your problem with stub code that only creates threads? > >> If yes, that indicates that you're messing with a thread s

Re: Mixing Python and C threads

2007-07-07 Thread Aahz
In article <[EMAIL PROTECTED]>, =?utf-8?b?U3TDqXBoYW5l?= Larouche <[EMAIL PROTECTED]> wrote: >Aahz pythoncraft.com> writes: >> >> Can you reproduce your problem with stub code that only creates threads? >> If yes, that indicates that you're messing with a thread structure >> somewhere. Note that

Re: Mixing Python and C threads

2007-07-07 Thread Stéphane Larouche
Aahz pythoncraft.com> writes: > Can you reproduce your problem with stub code that only creates threads? > If yes, that indicates that you're messing with a thread structure > somewhere. Note that because you're using gcc, it's possible there's a > thread bug on Windows with your tool chain. Yo

Re: Mixing Python and C threads

2007-07-07 Thread Aahz
In article <[EMAIL PROTECTED]>, =?utf-8?b?U3TDqXBoYW5l?= Larouche <[EMAIL PROTECTED]> wrote: >Aahz pythoncraft.com> writes: >> In article python.org>, >> =?utf-8?b?U3TDqXBoYW5l?= Larouche polymtl.ca> wrote: >>> >>>If I call the methods in the C++ modules from the Python main thread, I >>>don't

Re: Mixing Python and C threads

2007-07-06 Thread Stéphane Larouche
Aahz pythoncraft.com> writes: > In article python.org>, > =?utf-8?b?U3TDqXBoYW5l?= Larouche polymtl.ca> wrote: > > > >If I call the methods in the C++ modules from the Python main thread, I > >don't have any problem. However, they are usually called from another > >Python thread (using the thre

Re: Mixing Python and C threads

2007-07-06 Thread Aahz
In article <[EMAIL PROTECTED]>, =?utf-8?b?U3TDqXBoYW5l?= Larouche <[EMAIL PROTECTED]> wrote: > >If I call the methods in the C++ modules from the Python main thread, I >don't have any problem. However, they are usually called from another >Python thread (using the threading module) to keep the GUI

Mixing Python and C threads

2007-07-06 Thread Stéphane Larouche
I am currently developing a software called OpenFilters (available at www.polymtl.ca/larfis). Most of the software is written in Python, but the classes that do the hard work are written in C++ modules. Since, nowadays, most new computers have multiple cores and that I want to speed up the software

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-04 Thread casevh
> Here is my attempt to convert the C code, not written with speed in mind > and I was too lazy too time it. :-) > > from itertools import izip > > def pi(): > result = list() > d = 0 > e = 0 > f = [2000] * 2801 > for c in xrange(2800, 0, -14): > for b, g in izip(xrang

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Michael M. wrote: > * The C is very fast, Python not. > * Target: Do optimization, that Python runs nearly like C. As someone else already asked: Why? You can't beat a compiled to machine code language with an interpreted one when doing integer arithmetic. > counter=c >

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread casevh
Michael M. wrote: > Ok, here is the code. It is a translation of the following code, found > on the internet. > > * The C is very fast, Python not. > * Target: Do optimization, that Python runs nearly like C. There is an error in the translated code. It returns 1600 digits instead of 800 digits.

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Steven D'Aprano
On Thu, 04 Jan 2007 02:10:44 +0100, Michael M. wrote: > print "\nTiming a 1 million loop 'for loop' ..." > start = time.clock() > for x in range(100): >y = x # do something Why not "pass # do nothing"? > end = time.clock() > print "Time elapsed = ", end - start, "seconds" Are you awar

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread bearophileHUGS
Michael M.: > * The C is very fast, Python not. > * Target: Do optimization, that Python runs nearly like C. Python can't be fast as C for that kind of programs. Note that your original C program gives less digits than the Python program. Your original takes about ~15.2 s on my PC. The following v

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Gabriel Genellina
At Wednesday 3/1/2007 22:10, Michael M. wrote: Ok, here is the code. It is a translation of the following code, found on the internet. * The C is very fast, Python not. * Target: Do optimization, that Python runs nearly like C. Why? Python is strong in other aspects, *not* on computation spee

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Michael M.
Ok, here is the code. It is a translation of the following code, found on the internet. * The C is very fast, Python not. * Target: Do optimization, that Python runs nearly like C. Auf 800 Stellen in 160 Zeichen... -- int a=1,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5; for

SWIG, Python and C structures

2006-07-28 Thread RocketIII
Hi, I have structures like the following: typedef struct _SX { int i; char str[10]; } SX; typedef struct _SXA { int num_elements; SX sa[10]; } SXA; void myfunc1( SX *sx_p ); void myfunc2( SXA *sxa_p ); The swig interface file simply includes the .h-file with the '%include' statemen

Re: Python and C++

2006-07-25 Thread Roman Yakovenko
On 7/25/06, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > KraftDiner wrote: > > > What ways can I call my C++ classes from within Python. > > I've looked at boost but it would appear that there is little > > support or knowledge on boost in the python community. > > If you want to write Python wrappers

Re: Python and C++

2006-07-25 Thread Dave Kuhlman
KraftDiner wrote: > What ways can I call my C++ classes from within Python. > I've looked at boost but it would appear that there is little > support or knowledge on boost in the python community. If you want to write Python wrappers for C++ code *by hand*, look here: http://docs.python.org/

Re: Python and C++

2006-07-25 Thread Roman Yakovenko
On 25 Jul 2006 10:51:36 -0700, KraftDiner <[EMAIL PROTECTED]> wrote: > What ways can I call my C++ classes from within Python. > I've looked at boost but it would appear that there is little > support or knowledge on boost in the python community. It is not true! I am sure that if you ask you ques

Python and C++

2006-07-25 Thread KraftDiner
What ways can I call my C++ classes from within Python. I've looked at boost but it would appear that there is little support or knowledge on boost in the python community. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and C

2006-03-11 Thread Thomas Heller
Terry Reedy wrote: > "P Boy" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>> Has anyone yet written a program to grab C struct declaration from the >>> .h >>> to produce code like >>> >>> # Overlay configuration >>> class OverlayStoreConfig(ctypes.Structure): >>> _fields_ =

Re: Python and C

2006-03-10 Thread Terry Reedy
"P Boy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Has anyone yet written a program to grab C struct declaration from the >> .h >> to produce code like >> >> # Overlay configuration >> class OverlayStoreConfig(ctypes.Structure): >> _fields_ = [('FormatVersion', ctypes.c

Re: Python and C

2006-03-10 Thread P Boy
> Has anyone yet written a program to grab C struct declaration from the .h > to produce code like > > # Overlay configuration > class OverlayStoreConfig(ctypes.Structure): > _fields_ = [('FormatVersion', ctypes.c_ulong), > ('VolumeSize', ctypes.c_longlong), >

Re: Python and C

2006-03-10 Thread Alex Martelli
David Boddie <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > <[EMAIL PROTECTED]> wrote: > > > C is the lowest, most fundamental level of extension, but there are many > > other alternatives -- SWIG to wrap existing libraries, Boost or SCXX or > > SIP to wrap specifically C++ with very diffe

Re: Python and C

2006-03-10 Thread Terry Reedy
"P Boy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Ctypes is now a 2.5 standard lib module and in being tested as such on multiple systems. > I have a library from Micro

Re: Python and C

2006-03-10 Thread P Boy
I have written some C extension before but it was pretty tedious. I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Which you develop your C module in dynamic library (DLL in Windows world), the from Python, you can call the C functions in the

Re: Python and C

2006-03-10 Thread P Boy
I have written some C extension before but it was pretty tedious. I have recently found another approach by using ctypes (http://starship.python.net/crew/theller/ctypes/). Which you develop your C module in dynamic library (DLL in Windows world), the from Python, you can call the C functions in the

Re: Python and C

2006-03-10 Thread David Boddie
Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: > C is the lowest, most fundamental level of extension, but there are many > other alternatives -- SWIG to wrap existing libraries, Boost or SCXX or > SIP to wrap specifically C++ with very different philosophies (template > heavy, minimal, Qt-base

Re: Python and C

2006-03-10 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > I was a C Programmer for a while. Lately started to learn Python for > one small project at school. I joined a small company where they use > C++ for development. > > Can we use Python and C together ? I mean create some classes in Python > a

Re: Python and C

2006-03-10 Thread Diez B. Roggisch
> http://docs.python.org/api/api.html That should have been http://docs.python.org/ext/ext.html but you need the other one sooner or later. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and C

2006-03-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I was a C Programmer for a while. Lately started to learn Python for > one small project at school. I joined a small company where they use > C++ for development. > > Can we use Python and C together ? I mean create some classes in Python > and som

Python and C

2006-03-10 Thread diffuser78
I was a C Programmer for a while. Lately started to learn Python for one small project at school. I joined a small company where they use C++ for development. Can we use Python and C together ? I mean create some classes in Python and some number crunching algorithms coded in C (for speed) and

Swig, Python, and C++

2006-03-02 Thread Mich Peffe
Greetings All,I'm using SWIG for the first time and am running into some problems.  I've tried researching at swig.org and python.org, but unfortunately, most of the examples use programs I don't have, such as Solaris, Unix, and Irix.  I wish to make my C++ classes and functions accessible from Pyt

Wanted Python and C developer Urgently

2006-02-12 Thread Rozario, Sophia_Diana
ional Python tools, and to enhance and maintain the existing infrastructure. The ideal candidate will have a Bachelor's degree in Engineering or Science and will possess a sound knowledge of Python and C. Experience with maintaining or extending Python wrappers as well as some knowledge

Re: regarding python and c++ interaction

2005-10-05 Thread Fredrik Lundh
"parul garg" wrote: > i am new to python.i hav to call function of c++ .so file(shared > library)on linux. > any how i am not able to do that. > i had made one zoo.so file.when i import it this gives the following error... > import zoo > Traceback (most recent call last): > File "", line 1,

Re: regarding python and c++ interaction

2005-10-05 Thread Diez B. Roggisch
> i am new to python.i hav to call function of c++ .so file(shared > library)on linux. > any how i am not able to do that. > i had made one zoo.so file.when i import it this gives the following error... > > import zoo > > Traceback (most recent call last): > File "", line 1, in ? > ImportE

regarding python and c++ interaction

2005-10-05 Thread parul garg
hi i am new to python.i hav to call function of c++ .so file(shared library)on linux. any how i am not able to do that. i had made one zoo.so file.when i import it this gives the following error... >>> import zoo Traceback (most recent call last): File "", line 1, in ? ImportError: ./zoo.so: und

Re: LOC in Python and C++ in large projects

2005-07-01 Thread Terry Hancock
On Friday 01 July 2005 07:55 am, Adriaan Renting wrote: > I think it would be interesting if any readers with more experience as I > have would comment on how Python behaves in large projects, and how much > less lines they need compared to C++ or Java. > I have worked on several C++ projects with

Re: LOC in Python and C++ in large projects

2005-07-01 Thread Mike Meyer
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I think the choice of a programming language is not very important in > determining the overal succes of a project. C++ and Python are however > my two favorite languages. Well, getting done on time is a crucial part of success, and it takes less tim

LOC in Python and C++ in large projects

2005-07-01 Thread Adriaan Renting
I think the point you want to make is that Python needs vastly less lines of code as a similar application written in C++. I think Python might on average be 50-60% of comparable C++ code, but not the 1-2% you seem to want to claim. LOC is a somewhat arbitrairy measurement, but it gives an idea of