在时代精神启动板页上,给初学者提供了一个链接到python教程。
我已经从launchpad站点完全配置并安装了zeitgeist-1.0 tarball,但是在python编程时仍然找不到或使用zeitgeist模块。
请帮帮忙。编辑:
我还没有试过任何东西,我刚刚安装了整个软件包。我还安装了以下软件包。libzeitgeist-1.0-1:amd64 64 libzeitgeist-2.0-0:amd64 64 python-zeitgeist rhythmbox-plugin-zeitgeist时代主义时代精神-核心时代精神-数据中心时代精神-探索者。
此外,我在python3.5中使用ipython3。
发布于 2017-03-29 14:56:15
您必须安装python-zeitgeist模块:
pip install --user python-zeitgeist或
sudo apt-get install python-zeitgeist要查找示例代码,请查看这里
from zeitgeist.client import ZeitgeistClient
from zeitgeist.datamodel import *
zeitgeist = ZeitgeistClient()
def on_events_received(events):
if events:
song = events[0]
print "Last song: %s" % song.subjects[0].uri
else:
print "You haven't listened to any songs."
template = Event.new_for_values(subject_interpretation=Interpretation.AUDIO)
zeitgeist.find_events_for_template(template, on_events_received, num_events=1)
# Start a mainloop - note: the Qt mainloop also works
from gi.repository import GLib
GLib.MainLoop().run()https://stackoverflow.com/questions/43095293
复制相似问题