[wxpython-users] why doesn't fontlist sort work ?

Tim Roberts timr at probo.com
Fri May 2 10:38:43 PDT 2008


On Fri, 02 May 2008 10:14:28 +0200, Stef Mientki <s.mientki at ru.nl> wrote:
> hello,
> I want to see all available fonts,
> so I used the following:
>
>   fonts = wx.FontEnumerator ()
>   fonts.EnumerateFacenames ()
>   fontList = fonts.GetFacenames ()#.sort()
>   print fontList
>
> now if I want to see the list ordered,
> I would expect to add the sort() method
> (I've verified that the type of fontList equals list),
> but I get None ?
>   

Here again, we have one of the "classic Python blunders".  ;)  The 
list.sort() method does not return anything.  It sorts the list in 
place.  Try:
    fontList = fonts.GetFaceNames()
    fontList.sort()

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the wxpython-users mailing list