Re: How can I format unicode strings?

2009-09-09 Thread Duncan Booth
gentlestone wrote: > the error message i've got is: > > 'unicode' object has no attribute 'format' > > is the new formatting style newer then python 2.5? > > Have you tried reading the documentation? It generally tells you which version of Python introduced a feature: http://docs.python.org

Re: How can I format unicode strings?

2009-09-09 Thread Niklas Norrthon
On 9 Sep, 12:49, gentlestone wrote: > > I have python 2.5 > > return u'{0}'.format(self.name) > > doesn't work eigther > > the error message i've got is: > > 'unicode' object has no attribute 'format' > > is the new formatting style newer then python 2.5? Yes. The new string formatting appeared i

Re: How can I format unicode strings?

2009-09-09 Thread gentlestone
On 9. Sep., 12:31 h., Tim Northover wrote: > gentlestone writes: > >  return u"{}".format(self.name) > > > this one doesn't work on unicode strings. I there a not old formatting > > style possibilty for unicode strings? > > It looks like you're trying to mix python 3.1 and 2.6. In 2.6 you have >

Re: How can I format unicode strings?

2009-09-09 Thread Patrick Sabin
gentlestone schrieb: return u"{}".format(self.name) u"{0}".format(u"blah") works for me with python-2.6.2 Maybe your format string is wrong. - Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I format unicode strings?

2009-09-09 Thread Tim Northover
gentlestone writes: > return u"{}".format(self.name) > > this one doesn't work on unicode strings. I there a not old formatting > style possibilty for unicode strings? It looks like you're trying to mix python 3.1 and 2.6. In 2.6 you have to put a number inside the {} to tell it which argument

How can I format unicode strings?

2009-09-09 Thread gentlestone
return u"{}".format(self.name) this one doesn't work on unicode strings. I there a not old formatting style possibilty for unicode strings? Note: self.name can be unicode string! -- http://mail.python.org/mailman/listinfo/python-list