I want to read an input file that has the format:
['1,2,3\r\n', '4,5,6']
I want them to be separated so it will look like
['1', '2', '3', '4', '5', '6']
My code looks like
def importFile(file):
with open(file) as f:
content = f.readlines()
print content
for line in content:
tempList = line.split(',')
print tempList
Unfortunately, what I'm getting right now is
['4', '5', '6']
Where did I do wrong? Can anyone help me?