Your mission is to
write a program to
open any text file
containing a tree like this one
and output
a python list
having the same structure as this tree
for example
this is a nested node
but this one
is more deeply nested
You can add an option
to accept different encodings
for the file
et voilà!
The output list must be the following
['',
[u'Your mission is to'],
[u'write a program to'],
[u'open any text file', [u'containing a tree like this one']],
[u'and output',
[u'a python list'],
[u'having the same structure as this tree'],
[u'for example',
[u'this is a nested node'],
[u'but this one', [u'is more deeply nested']]],
[u'You can add an option',
[u'to accept different encodings'],
[u'for the file']],
[u'et voil\xe0!']]]
Now you wrote your first text parser.