Python は C++ 関数を呼び出しています (swig を使用してラップされています)。
C++:
std::wstring getFilePathMultiByte();
この関数は Python で呼び出すことができます。質問は、この返された wstring をどのように使用するかです。以下の出力に示すように、このパスにファイル名を追加するとエラーが発生します。
パイソン:
path = getFilePathMultiByte()
print path, type(path)
file = path + "/Information.log"
出力:
_2012ad3900000000_p_std__wstring, type 'SwigPyObject'
TypeError: unsupported operand type(s) for +: 'SwigPyObject' and 'str'
Pythonでstd::wstringを作成するにはどうすればよいですか? これにより、連結が可能になる場合があります。
ありがとう。