我如何从 Kodi 中 运行 一个 python 脚本?

How can I run a python script from within Kodi?

如果我想在 Kodi 的菜单中制作一个按钮,并在单击它时 运行 一个本地 python 脚本,最好的方法是什么?

file_path = xbmc.translatePath(os.path.join('insert path here to file you want to run')) xbmc.executebuiltin("XBMC.RunScript("+file_path+")")

很晚才回复,但看到没有其他人回复所以尽管我还是放在了以防万一