[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Converting font names to python strings
From:       "Giovanni Bajo" <rasky () develer ! com>
Date:       2005-04-19 14:02:58
Message-ID: 0b4201c544e8$7dad54a0$bf03030a () trilan
[Download RAW message or body]

Jeremy Sanders <jeremy@jeremysanders.net> wrote:

>> You could use unicode(i) to convert QString to a Python unicode string.
>> Either that, or keep the QString. It pretty much depends on what you are
>> going to do with that families dict.
> 
> Excellent. I'm doing things like
> 
> if 'Times New Roman' in families:
>     # do something I shouldn't here
> 
> to check whether we have fonts installed.
> So as long as that works (which it appears to do), it should be okay...


Sure. To double check, you can use the good ol' interactive shell:

>>> a = {}
>>> a[u'ciao'] = True
>>> u'ciao' in a
True
>>> 'ciao' in a
True
>>> a
{u'ciao': True}

-- 
Giovanni Bajo

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic