- 帖子
- 13
- 精华
- 0
- 积分
- 64
- 阅读权限
- 20
- 注册时间
- 2018-2-26
- 最后登录
- 2020-3-17
|
大神们帮忙看看错在哪里
原代码
#-*- coding: UTF-8 -*-
import urllib2
import json
from city import city
cityname = raw_input("你想查哪个城市的天气?\n")
citycode = city.get(cityname)
if citycode:
url = ('http://www.weather.com.cn/data/ctyinfo/%s.html'%citycode)
content = urllib2.urlopen(url).read()
print content
错误提示:
Traceback (most recent call last):
File "D:/Python27/66666666666666.py", line 4, in <module>
from city import city
File "D:/Python27\city.py", line 2
SyntaxError: Non-ASCII character '\xb1' in file D:/Python27\city.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
|
|