i = 1
s='<td height="23" width="72" align="center" background="/images/r_tembg4.gif" class="rb12">(.+)</td>'
city=re.compile(s)
f=open('city.dat','w',0)
while True:
data=urllib.urlopen("http://weather.news.qq.com/inc/ss" + str(i) + ".htm").read()
for t in city.findall(data): f.write(str(i)+':'+t+'\n')
i+=1