Re: [gnome-love] "import Gtk" not working
- From: ruwan thushara <thushararuwan88 gmail com>
- To: Jerome Flesch <jflesch gmail com>
- Cc: gnome-love gnome org
- Subject: Re: [gnome-love] "import Gtk" not working
- Date: Wed, 27 Feb 2013 14:42:14 +0530
Thanks for your consideration. I understand the idea.
On Wed, Feb 27, 2013 at 2:13 PM, Jerome Flesch
<jflesch gmail com> wrote:
Hello,
I'm no gtk specialist, but my understanding is that
- 'import gtk' (not Gtk) implies using the pygtk bindings (--> gtk 2)
- 'from gi.repository import Gtk' implies using the GObject Introspection bindings (--> gtk 3)
If I'm not mistaken, GObject Introspection bindings are automatically generated for libraries supporting them. It allows creating bindings for many programming languages automatically (Python included). For instance libpoppler provides GI bindings as well and they can be imported with "from gi.repository import Poppler. The visible side effect is that all Python programs must import these bindings by using the pattern "from gi.repository import <X>".
Hope it helps,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]