SWIG typemap

Giorgi Lekishvili gleki at gol.ge
Fri Aug 30 15:57:59 CEST 2002

Hi all!

I make some regular error in typemapping for SWIG.

Here is my interface file:
%module translit

#include "translit.h"

%typemap (in) file {
 printf(Received a python file object , $1);

extern void initTables();
extern void convert(char *buffer,FILE *outStream);
extern char *readData(FILE *inStream);


Here is the Traceback:

>>> from translit import *
>>> s="ja idu, shagaju po Moskve"
>>> f=open("test.txt", "w")
>>> convert (s, f)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: Type error. Expected _p_FILE

>>> import translit
>>> dir(translit)
['__doc__', '__file__', '__name__', 'convert', 'initTables', 'readData']


The error I am making must be indeed stupid :)) Yet, I cannot catch

Thanx in advance


More information about the Python-list mailing list