How to right align IPaddress?

2005-06-17 Thread praba kar
Dear all, 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 with regards, Prabahar

Re: How to right align IPaddress?

2005-06-17 Thread qwweeeit
IPnumber.rjust(15) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to right align IPaddress?

2005-06-17 Thread Denis S. Otkidach
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

Re: How to right align IPaddress?

2005-06-17 Thread qwweeeit
Hi, the solution is a little more involved, if you want to right justify each of the four components of IP number: import sys try: .sIPnumber=sys.argv[1] except: . sys.exit(-1) list_lPcomponents=sIPnumber.split('.') sRJ='' for n in list_IPcomponents: . sRJ+=n.rjust(3)+'.' print sRJ[:-1]

Re: How to right align IPaddress?

2005-06-17 Thread Piet van Oostrum
praba kar [EMAIL PROTECTED] (pk) wrote: pk Dear all, pk Is it possible to right align pk the Ipaddress? Normally we can pk right align the list of numbers pk by %3u or %7u. How we can right pk align the Ipaddress? pk I expects below format output pk eg 203.199.200.0 pk 203.33.20.0