我在python中写openweathermap网站appindicator,但我只需要指针中没有图标的文字标签.但是当我离开""然后给我看空图标.为什么,我只需要文字.在Ubuntu 12.04中,python-appindicator不需要图标如果离开""然后不加载空图标,但在ubuntu 14.04中留下空图标.如何禁用图标?有任何想法吗?
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib2
import json
import time
import datetime
from gi.repository import Gtk, Gdk, GLib, GObject
from gi.repository import AppIndicator3 as appindicator
class programa:
def __init__(self):
# Create Indicator with icon and label
# If leave empty "" then load empty icon
self.ind = appindicator.Indicator.new("Weather","",appindicator.IndicatorCategory.APPLICATION_STATUS)
self.ind.set_status(appindicator.IndicatorStatus.ACTIVE) #
self.menu_structure()
# Menu structure
def menu_structure(self):
refresh = 720 # Refresh interval in seconds
url = urllib2.Request('http://api.openweathermap.org/data/2.5/weather?q=siauliai&units=metric')
openup = urllib2.urlopen(url) …Run Code Online (Sandbox Code Playgroud)