[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Dictionary Question

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Dictionary Question
Date: Mon, 21 Feb 2005 09:32:40 +0100
User-agent: Mutt/

> I want to read the contents of a text box
>  eg  line1 = self.text1..GetValue() ?is this the way as it seems to work
>       line2 = self.text2..GetValue() etc
> Then I want to be able to put these into a dictionary
> mydict = {}
> mydict[0] = line1, line2, line3, line4, line5
What you are doing here is putting a *list* of lines into the
dict entry labelled "0". Hence it shows:

> {0: (u'', u'omeprazole', u'omeprazole magnesium', u'Losec Tablets', u'20mg', 
> u'1 mane')}

> This looks like a dictionary structure but has a 'u' character before each 
> string?
Unicode tag. No need to worry so far.

You want to do:

mydict = {}
mydict['line 0'] = line0
mydict['line 1'] = line1

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

[Prev in Thread] Current Thread [Next in Thread]