[PyQt] Re: Problem with QString API v2

detlev detlev at die-offenbachs.de
Fri Dec 18 16:14:51 GMT 2009


On Freitag, 18. Dezember 2009, Phil Thompson wrote:
> On Fri, 18 Dec 2009 15:34:19 +0100, detlev <detlev at die-offenbachs.de>
> 
> wrote:
> > Hi,
> >
> > how do I port code like
> >
> >>>> l="hh"
> >>>> t=app.translate("Test", "s - %1 - e").arg(l)
> >
> > to the QString API version 2? I need to have the relocatable
> 
> placeholders.
> 
> Use Python's...
> 
>     t = app.translate("Test", "s - {0} - e").format(l)
> 

Thanks Phil. I didn't realize that this works in Python 2.6 already. I thought 
it was a Py3 feature.

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list