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
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
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