可以将 Clutter 与 Python 3 一起使用吗?
有针对 Clutter 的 Python 3 绑定吗?如果是这样,我怎样才能获得它们并使用它们?
Are there Python 3 bindings for Clutter? If so, how can I get them and use them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Lattyware 所说,在 Python 3 中使用 Clutter 的方法是安装“GObject introspection”数据并允许 GObject 动态生成到原始 C 库的绑定。
在 Ubuntu 11.10 上,安装 Python 3 GObject 和 GObject 自省数据以防止混乱:
在 Ubuntu 12.04 及更高版本上,
python3-gobject
包已重命名为python3-gi
:如果要安装GTK+ Clutter库:
如果使用
virtualenv
虚拟Python环境,使用以下命令,这可以让Python找到GObject内省库:要在 Python 3 中使用 Clutter 或 GtkClutter:
包 gi.repository 是一个特殊的包,它动态生成这些 Python 类。
As stated by Lattyware, the way to use Clutter in Python 3 is by installing "GObject introspection" data and allowing GObject to dynamically generate the bindings to the original C library.
On Ubuntu 11.10, install both Python 3 GObject and the GObject introspection data for clutter:
On Ubuntu 12.04 and later, the
python3-gobject
package has been renamed topython3-gi
:If you want to install the GTK+ Clutter library:
If using a
virtualenv
virtual Python environment, use the following command, which allows Python to find the GObject introspection libraries:To use Clutter or GtkClutter in Python 3:
The package
gi.repository
is a special package which dynamically generates these Python classes.据我所知,答案是使用 GObject 而不是直接绑定,并且 < a href="https://live.gnome.org/PyGObject" rel="nofollow noreferrer">PyGObject 似乎有一个 Python 3 分支 显然有效 - 并不是我个人使用过它。
您可能还想查看这个有关在 python 3 中使用 PyGObject 的问题。
From what I gather, the answer is to use GObject rather than direct bindings, and PyGObject appears to have a Python 3 branch that apparently works - not that I have used it personally.
You might also want to see this question on using PyGObject with python 3.