ui_python: improve python binding