5 May 2004 09:09
How to use a C++ std::string from Python
Rolf Wester <rolf.wester <at> ilt.fraunhofer.de>
2004-05-05 07:09:00 GMT
2004-05-05 07:09:00 GMT
Hi,
a have a C++ module with functions that have std::string parameters. The
build works fine but
I don't know how to call such a method. When using a Python string as
function parameter I get
an error message:
>>> im.read_bmp_file("dvac001.bmp",0)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "image.py", line 423, in read_bmp_file
def read_bmp_file(*args): return _image.Image_read_bmp_file(*args)
TypeError: Type error. Got dvac001.bmp, expected _p_std__string
How can I call this function from Python? I would be very appreciative
for any help.
With kind regards
Rolf Wester
_______________________________________________
Swig maillist - Swig <at> cs.uchicago.edu
http://mailman.cs.uchicago.edu/mailman/listinfo/swig
RSS Feed