为什么解析csv文件不会将事情分解为“逻辑”顺序?

我正在尝试使用内置的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']

如何将这些条目分成词典列表?


哈士奇WWW
浏览 146回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python