Reading a file in python issues -
i trying read csv file in python using following code:
with open(self.filename, 'r') openfile: datareading = openfile.read() openfile.close() splitdata = datareading.split("\n") print splitdat
a don't understand why not getting output.
self.filename
meant represent file location on computer, , attempting open , split there new lines. can please assist me problem?
you storing read line in datareading
, doing read_data.split()
you might intending this:
def convert(self): datareading = [] open(self.filename, 'r') openfile: datareading = openfile.readlines() data in datareading: print data
Comments
Post a Comment