I am not certain if I understand your problem, but I think you are just
trying to read in a string and create a visable matrix.  If that is true,
then may some of the code below will work.  This is in no way elegant.
++++++++++++++++++++++++++++++++++++++++++

count = 1
width = 2                  #the width of your matrix
string="aaaaaaaaaa"        #input string to piece up
final=""                   #output string
for character in string:
 if count == width :
    final = "%s%s\n" % (final,character)
    count = 1
 else:
    final = "%s%s" % (final,character)
    count += 1
print final

On 28 Feb 2007 16:06:08 -0800, Ryan K <[EMAIL PROTECTED]> wrote:

I'm trying to text wrap a string but not using the textwrap module. I
have 24x9 "matrix"  and the string needs to be text wrapped according
to those dimensions. Is there a known algorithm for this? Maybe some
kind of regular expression? I'm having difficulty programming the
algorithm. Thanks,
Ryan

--
http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to