0

私は 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.

ありがとう!

4

2 に答える 2

2

ご助力いただきありがとうございます!ユーザーエラーでしたが、お問い合わせにお答えいただくことで、自分自身を理解することができました。ファイルを閉じる前に、ファイルをどこかに送信していました。あぁ...

for key, value in csvOutput.items():
    writer.writerow([key, value])

f1.close() # I hadn't closed it here.

f2 = open(csvFileName)
jira.add_attachment(issueKey, f)
f2.close()

ありがとう!

于 2013-06-21T20:55:13.440 に答える