Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 Ubuntu 编写一个小脚本。我的意图是用全局快捷方式(配置gnome)调用节奏盒歌词插件。我可以从节奏盒 python 控制台调用它,但我不知道如何导入节奏盒内置模块(例如节奏数据库)。 有任何想法吗?
您不能从标准 python 控制台导入节奏盒“内置”模块。
据我所知,它们不是真正的模块,它们只是节奏盒过程中暴露给插件的对象。因此,只有当您从节奏盒进程运行脚本时,您才能访问它们。
在这种情况下,我想你必须自己编写整个插件,然后听 dbus 以更改节奏盒中的歌曲,以检测正在播放的歌曲。