|
From: | Hilmar Berger |
Subject: | [Gnumed-devel] Re: Dictionary Question |
Date: | Fri, 18 Feb 2005 14:00:02 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax) |
Hi Richard,u'' means that this is a unicode string - you can work with these or change their coding to ordinary strings, e.g.
u'my text'.encode('latin-1') gives you 'my text" as ordinary string. Hilmar Richard Terry schrieb:
Karsten et al, Can you help me with something simple. 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 if I print out mydict (as you can see I put drug stuff in it) I get this:{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?Any help appreciated. richard
-- Hilmar Berger Studienkoordinator Institut für medizinische Informatik, Statistik und Epidemiologie Universität Leipzig Härtelstr. 16-18 D-04107 Leipzig Tel. +49 341 97 16 101 Fax. +49 341 97 16 109 email: address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |