0

I want to create the csv file - output.csv

I run this python code ( version 3.4.3 ) from my Visual studio 10

import csv
RESULT = ['linux','solaris','unix','aix','win']
resultFile = open("output.csv",'wb')
wr = csv.writer(resultFile, dialect='excel')
wr.writerow(RESULT)

but from unclear reason I get this errors

 TypeError Occurred
 'str' dose not support the buffer interface

this error is after the wr.writerow(RESULT) line ( with red sign )

what its wrong here

  • remark - I must to say - when I write the wr. ( the last line ) then after the dot "." I not see auto completion
maihabunash
  • 1,632
  • 9
  • 34
  • 60

1 Answers1

0

Try changing the way you write your result:

wr.writerow(bytes(RESULT, 'UTF-8'))
Undo
  • 25,519
  • 37
  • 106
  • 129
farhawa
  • 10,120
  • 16
  • 49
  • 91