making a string a given length?

Emile van Sebille emile at fenx.com
Sat May 27 16:48:20 EDT 2000


Or, in 1.6:

>>> "hello".rjust(20)
'               hello'
>>> "hello".ljust(20)
'hello               '


Emile van Sebille
emile at fenx.com
-------------------


----- Original Message -----
From: Moshe Zadka <moshez at math.huji.ac.il>
To: Z 3 Penguin <z3penguin at penguinpowered.com>
Cc: <python-list at python.org>
Sent: Saturday, May 27, 2000 1:46 PM
Subject: Re: making a string a given length?


> On Sat, 27 May 2000, Z 3 Penguin wrote:
>
> > For a python program to interface with gnutella, i need to make a
string
> > (like +ACI-abc+ACI-) a given number of bytes long.  is there anyway
to do this
> > without having to write my own function?
>
> string.fill?
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list