File Read/Write test program

Manuel M. Garcia mgarcia at cole-switches.com
Tue Jan 7 21:11:43 EST 2003


meg = "*" * (1048576 * 20)

gives you a string of length 1048576 * 20 in one step

Manuel

On Tue, 7 Jan 2003 20:11:33 +0000, andy <andy at eastonwest.co.uk> wrote:
(edit)
>def generate_chunk(megabytes):
>    """ returns a string containing megabytes*1048576 asterisks """
>    meg="*"
>    for n in range(20):
>        meg=meg+meg
>    chunk=""
>    for n in range(megabytes):
>        chunk=chunk+meg
>    return chunk





More information about the Python-list mailing list