On Fri, 17 Jun 2005 09:46:52 +0100 (BST)
praba kar <[EMAIL PROTECTED]> wrote:

>      Is it possible to right align
> the Ipaddress?  Normally we can
> right align the  list of numbers
> by %3u or %7u.  How we can right
> align the Ipaddress? 
> 
> I expects below format output
> eg 203.199.200.0
>      203.33.20.0

>>> for ip in ('203.199.200.0', '203.33.20.0'):
...     print '%15s' % ip
... 
  203.199.200.0
    203.33.20.0
>>> for ip in ('203.199.200.0', '203.33.20.0'):
...     print ip.rjust(15)
... 
  203.199.200.0
    203.33.20.0

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to