Re: Parameterize formatting string

2007-09-21 Thread Jean-Paul Calderone
On Fri, 21 Sep 2007 20:16:29 +0200, David <[EMAIL PROTECTED]> wrote: >On 9/21/07, cyril giraudon <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I 'd like to know if a std::setw() equivalent function exists in >> python ? >> >> i thought of something like : >> >> a = 16 >> "%ai" % 12 >> >> But it is not

Re: Parameterize formatting string

2007-09-21 Thread Carsten Haese
On Fri, 2007-09-21 at 20:16 +0200, David wrote: > Or, more ugly: > > "%%%di" % a % 12 Or, less ugly: "%*i" % (a,12) -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Parameterize formatting string

2007-09-21 Thread David
On 9/21/07, cyril giraudon <[EMAIL PROTECTED]> wrote: > Hello, > > I 'd like to know if a std::setw() equivalent function exists in > python ? > > i thought of something like : > > a = 16 > "%ai" % 12 > > But it is not correct. > > Any Idea ? ("%i" % 12).rjust(a) Or, more ugly: "%%%di" % a % 12

Parameterize formatting string

2007-09-21 Thread cyril giraudon
Hello, I 'd like to know if a std::setw() equivalent function exists in python ? i thought of something like : a = 16 "%ai" % 12 But it is not correct. Any Idea ? Thanks a lot, Cyril. -- http://mail.python.org/mailman/listinfo/python-list