python / C++ signature [SOLVED]


Using a rocket function, I got an error, and I think I understand it, but I don’t know how to avoid it.
the code

face="./datafiles/images/faces/" + face + ".png"

the error

Boost.Python.ArgumentError: Python argument types in
    Element.SetAttribute(Image, str, unicode)
did not match C++ signature:
    SetAttribute(class Rocket::Core::Element *, char const *, char const *)

and when I do this, it works:


In the signature, it wants two const char *, and I give to it, once a const char * (“src”) and the other argument is a variable (face), and not a const char *.

How can I cast my face to a const char * in python?

Thank you

str( str1 + str2 + str3 ) ?


In fact, my data was coming from a mysql database, and face=row[1] in a fetch.

using face=str(row[1]) solved my problem

Thank you anyway