Python 3能否与Clutter一起使用?

6

是否有Clutter的Python 3绑定?如果有,我该如何获取并使用它们?


1
我刚刚发现了这份文档:https://clutter-and-mx-under-python3.readthedocs.org/en/latest/index.html,它似乎对于在py3中使用clutter很有用。希望对你有帮助。 - AkiRoss
2个回答

4
如Lattyware所述,使用Python 3中的Clutter的方法是安装“GObject introspection”数据并允许GObject动态生成到原始C库的绑定。
在Ubuntu 11.10上,安装Python 3 GObject和Clutter的GObject introspection数据:
sudo apt-get install python3-gobject gir1.2-clutter-1.0

在Ubuntu 12.04及以上版本中,python3-gobject软件包已更名为python3-gi
sudo apt-get install python3-gi gir1.2-clutter-1.0

如果您想安装GTK+ Clutter库:
sudo apt-get install python3-gi gir1.2-gtkclutter-1.0

如果使用virtualenv虚拟Python环境,则需要使用以下命令,使Python能够找到GObject introspection库:
virtualenv env -p python3 --system-site-packages

要在Python 3中使用Clutter或GtkClutter:

from gi.repository import Clutter
from gi.repository import GtkClutter

gi.repository 这个软件包是一个特殊的软件包,它动态生成了这些 Python 类。


3

1
我已经在Python 3中使用python-gobject。我想知道是否可能在Python 3中使用clutter。 - argentpepper

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接