pieces = []
while len(message) > 600:
pieces.append(message[:600]) # slice from the start up to (but not including) the 600th character.
message= message[600:] #slice from the 600th character to the end.
pieces.append(message)
That should split the string up into pieces that are 600 characters long or less. The pieces are stored in the list 'pieces'.
Last edited by scru; Feb 25th, 2009 at 1:18 pm.
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
Offline 1,624 posts
since Feb 2007