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

[plamo:31801] python と gtk3



加藤泰文です。

python で gtk3 を使ってるアプリが動かない事があります。gtk+ と
pygobject3 とかその辺りの話?

#!/usr/bin/python
from gi.repository import Gtk

print Gtk._version
print Gtk.get_major_version

こんなコードを書いて、実行すると

$ python test.py
/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py:48: RuntimeWarning: You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0
  warnings.warn(warn_msg, RuntimeWarning)
2.0
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    print Gtk.get_major_version
  File "/usr/lib64/python2.7/site-packages/gi/module.py", line 316, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib64/python2.7/site-packages/gi/module.py", line 135, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'get_major_version'

こんな感じになります。まだまだこの周辺で色々更新しないとダメ?

-- 
==============================================
((((    加藤泰文
○-○                karma @ jazz.email.ne.jp
==============================================
 (Web Page) http://www.ten-forward.ws/
==============================================


Follow-Ups
[plamo:31802] Re: python と gtk3, KATOH Yasufumi

[検索ページ] [メール一覧]
Plamo ML 公開システム