On Tue, Jun 10, 2008 at 7:45 AM, bob gailer <[EMAIL PROTECTED]> wrote:
> questionary = []
>
> for line in textdata.split('\n'):
>   if line:
>       tag, content = line.split(' ', 1)
         tag = tag[1:] # strip leading %
>       if tag == "question":
>           questionary.append({tag : content})
>       else:
>           questionary[-1].update({tag : content})

or
  questionary[-1][tag] = content

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to