Skip to content

Commit f58c67a

Browse files
committed
Merge pull request REMitchell#6 from muxuezi/patch-3
Update 2-createCsv.py
2 parents ae0e547 + b2f1b24 commit f58c67a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chapter5/2-createCsv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import csv
22
#from os import open
33

4-
csvFile = open("../files/test.csv", 'w+')
4+
csvFile = open("../files/test.csv", 'w+', newline='')
55
try:
66
writer = csv.writer(csvFile)
77
writer.writerow(('number', 'number plus 2', 'number times 2'))
88
for i in range(10):
99
writer.writerow( (i, i+2, i*2))
1010
finally:
11-
csvFile.close()
11+
csvFile.close()

0 commit comments

Comments
 (0)