我正在尝试使用内置的python csv阅读器来解析csv文件,如下所示:
sms_prices_list_url = "http://www.twilio.com/resources/rates/international-sms-rates.csv"
sms_prices_list = requests.get(sms_prices_list_url)
reader = csv.reader(sms_prices_list.text)
for row in reader:
print row
但是,当我这样做时,几乎所有内容都是按字符而不是按字典项或列项打印的,例如:
['C']
['o']
['u']
['n']
['t']
['r']
['y']
['', '']
[' ']
['N']
['a']
['m']
['e']
['', '']
[' ']
['R']
['a']
['t']
['e']
[]
['', '']
['UNITED STATES Inbound SMS - Other']
['', '']
['0']
如何将这些条目分成词典列表?
相关分类