I have tried ways on converting list to strings as found in other questions but the output doesn't seem to be what I should get. I have an input of [['This','is','here.'],['Second','sentence','here.']]
and I would like to convert this to string and be saved to a text file with the output:
This is here.
Second sentence here.
what I did is,
list = [['This','is','here.'],['Second','sentence','here.']]
with open(outfile, 'w') as newfile:
newfile.write(str('\n'.join((str(i) for i in list))))
The output of this in the .txt file is:
['This', 'is', 'here.']
['Second', 'sentence', 'here.']
A help is very much appreciated. thanks!