I am trying to spilt a message in two, if the number of characters is greater that 600, so that each message has no more than 600 characters.

How can i do this
i know how to get the message length

Message = "sdkfhdslkfhdskfhsdlfjsdlk"
print len(Message)

but i am not sure od how to split it.

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'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.