import math


def split_string_into_lines( string, colwidth ):
	""" splits a string into lines with <colwidth> characters in one line """
	i = 0
	splitstring = ''
	iterations = math.ceil( 1.0 * len( string ) / colwidth )
	for i in range( int ( iterations ) ):
		start = i*colwidth
		end = ((i+1)*colwidth)-1
		splitstring += string[start:end] + '\n'
	if splitstring.endswith( '\n' ):
		splitstring = splitstring.rstrip( '\n' )
	return splitstring