By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,095 Members | 1,586 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,095 IT Pros & Developers. It's quick & easy.

C pointer representation in python

P: n/a
Hi
I am new to SWIG and python. I have a problem while trying to call a C
function from Python using SWIG as an interface. The function is
defined as follows.

void* myfunc(TfichierDLR *fichier, char *nom, char *type, char *txt,
char *classe, TicThemeDLR *icTheme, int **num, int *ier)

The last two are output parameters (**num and *ier) and i wonder how
to represent those while calling from python. Especially 'num' being a
double pointer is tricky to handle. Also how can we represent the
return variable which is a null pointer.

I would be extremely pleased to hear any ideas/suggestions in this
regard.

Regards
Arun
Nov 26 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

<ab******@gmail.comwrote in message
news:f5**********************************@d4g2000p rg.googlegroups.com...
| Hi
| I am new to SWIG and python. I have a problem while trying to call a C
| function from Python using SWIG as an interface.

Did you consider using the ctypes module?
(It is new in the stdlib for 2.5, I believe.)
Some consider it easier to use than swig.

Nov 26 '07 #2

P: n/a
HI
Thanks for the suggestion and i believe that seems a good idea. But
because of some work related constraints i have to use SWIG for the
moment.
Regards
Arun

Terry Reedy wrote:
<ab******@gmail.comwrote in message
news:f5**********************************@d4g2000p rg.googlegroups.com...
| Hi
| I am new to SWIG and python. I have a problem while trying to call a C
| function from Python using SWIG as an interface.

Did you consider using the ctypes module?
(It is new in the stdlib for 2.5, I believe.)
Some consider it easier to use than swig.
Nov 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.