You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data = {}
for i in range (1,len(result)):
for j in range (0 , len( result[i]) ):
key = re.sub(' +', ' ', result[0][j])
value = re.sub(' +', ' ', result[i][j])
data[key] = value
print data
目前parse的資料,可以用python內建的dict來存取,因為dict也是key : value的方式存取資料,跟json很像
ex:
存好的資料用python內建的json模組就可以把dict轉成json了
ex:
http://docs.python.org/2/library/json.html
我遇到的問題是:python的編碼是個大麻煩,在parse資料時好像已經編碼過一次了,於是我在這邊print 出來的data會是我看不懂的地方,可能還要麻煩 @Lee-W 看看要怎麼能夠克服編碼的問題
The text was updated successfully, but these errors were encountered: