I have this complex list:
boundarylist = [('eː', 'n'), ('a', 'k'), ('a', 's')]
I want to convert boundarylist
to a string, so that I can store it in an external .txt file.
boundarystring = ' '.join(boundarylist)
does not work. The output should be something like this:
boundarystring = 'eːn ak as' #seperated by \s or \n
I tried these algorithms suggested in “”.join(list) if list contains a nested list in python?, but it returns 'eːnakas' respectively 'eː n a k a s':
import itertools
lst = [['a', 'b'], ['c', 'd']]
''.join(itertools.chain(*lst))
'abcd'
and
''.join(''.join(inner) for inner in outer)