Robert Kern wrote: > David Pratt wrote: > >> I have string text with language text records that looks like this: >> >> 'en' | 'the brown cow' | 'fr' | 'la vache brun'
> translations = [x.strip(" '") for x in line.split('|')]
> d = dict(zip(translations[::2], translations[1::2]))
One caevat is that this assumes that the proto-list doesn't have any '|'
inside the actual text.
--
http://mail.python.org/mailman/listinfo/python-list
