How can I get the full file path of an icon name?
问题 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