+ -
当前位置:首页 → 问答吧 → ibus五笔输入法图标的问题

ibus五笔输入法图标的问题

时间:2011-08-14

来源:互联网

刚写了个获取天气的python脚本

然后发现conky不显示这个脚本的输出???

只显示 ${python}

这个是神马东东???


附赠获取天气的脚本,获取的是中国天气网的
附件:
get.py [988 Bytes]
还未被下载

作者: caihong06   发布时间: 2011-08-14

问题解决,擦,一个不知道什么问题的问题,重新覆盖了一下子,好了

顺便修改了一下获取天气的代码
代码:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import sys, urllib2, simplejson
reload(sys)
sys.setdefaultencoding('utf-8')
headers = {
    'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'
}
req = urllib2.Request(
    url = 'http://m.weather.com.cn/data/101070101.html',
    headers = headers
)
fd = urllib2.urlopen(req)
data = fd.read()
info = simplejson.loads(data)
#for location in locations
time = unicode('更新时间:', 'utf-8') + info["weatherinfo"]["fchh"] + unicode(' 点', 'utf-8')
result = unicode('今日:', 'utf-8') + info["weatherinfo"]["weather1"] + info["weatherinfo"]["temp1"]
result2 = unicode('明日:', 'utf-8') + info["weatherinfo"]["weather2"] + info["weatherinfo"]["temp2"]
result3 = unicode('后天:', 'utf-8') + info["weatherinfo"]["weather3"] + info["weatherinfo"]["temp3"]
print time
print result
print result2
print result3


我没找到问题的原因

但是问题就这么解决了



封帖

作者: caihong06   发布时间: 2011-08-14