ibus五笔输入法图标的问题
时间:2011-08-14
来源:互联网
刚写了个获取天气的python脚本
然后发现conky不显示这个脚本的输出???
只显示 ${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
# -*- 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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28