[gnome-love] "import Gtk" not working



Hi
I designed ui using glade and connect it with python code. when i use "import Gtk" In the python code it gives import error in the terminal like below,
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import Gtk
ImportError: No module named Gtk


But when i use "from gi.repository import Gtk" it works as expected.
problem is why can't I just import Gtk in to the code?

Thanx


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]