How can I get the full file path of an icon name?

余生长醉 提交于 2021-02-18 21:10:05

问题


How can I get the full file path from an icon name in GNOME?


回答1:


import gtk
icon_theme = gtk.icon_theme_get_default()
icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0)
print icon_info.get_filename()



回答2:


Translation for Python 3:

from gi.repository import Gtk
icon_theme = Gtk.IconTheme.get_default()
icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0)
print(icon_info.get_filename())


来源:https://stackoverflow.com/questions/6090241/how-can-i-get-the-full-file-path-of-an-icon-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!