Re: [gnome-love] "import Gtk" not working
- From: Jerome Flesch <jflesch gmail com>
- To: ruwan thushara <thushararuwan88 gmail com>
- Cc: gnome-love gnome org
- Subject: Re: [gnome-love] "import Gtk" not working
- Date: Wed, 27 Feb 2013 09:43:57 +0100
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]