>>>> import textwrap >>>> print textwrap.fill("HelloWorld", 2) > He > ll > oW > or > ld > > Of course if your assertion that the string contains no spaces, tabs or > newlines turns out to be incorrect this may not do what you wanted.
Thanks, i just found this myself and it works fine, but very slow... The script without the wrapping takes 30 seconds, with wrapping 30 minutes. Is there not a more efficient way? The perl syntax i posted is much faster. -- http://mail.python.org/mailman/listinfo/python-list