のようなことをしてまで努めていたが、そうなると実行関数名の取得もしたい。こんなときはinspect.currentframe().f_code.co_name をつかうのだが、execすると実行フレームがトップレベルに飛ばされてしまい、'<module>'が戻ってくる。はてさてとPerplexity君に訊いてみ ...
When PY_VERSION_HEX >= 0x03010000, boost::python::exec_file passes an invalid string to Py_RunFile. The problem is that char* f points to a temporary buffer returned by the UTF conversion routine ...