我有一个简单的字典,我正在写入一个 csv 文件,当我在服务器上查看它时它看起来很好,但它在 excel 中完全是空白的。
csvOutput = {'http://www.test.com/': 'This source is currently in the system.', 'http://test.com/': 'This source is not currently in the system.', 'http://www.test.com/': 'This source is currently in the system.'}
writer = csv.writer(open(csvFileName, 'wb'), quoting=csv.QUOTE_NONE, dialect='excel')
for key, value in csvOutput.items():
writer.writerow([key, value])
谢谢你的帮助!
这是我在 vim 文件中看到的内容:
http://www.test.com/,This source is currently in the system.
http://test.com/,This source is not currently in the system.
http://www.test.com/,This source is currently in the system.
谢谢!