def split_semicolon(line, maxsplit=None):
 splitted_line = line.split(';')
 splitted_line_size = len(splitted_line)
 if ((maxsplit is None) or (0 > maxsplit)):
  maxsplit = splitted_line_size
 i = 0
 while (i < (splitted_line_size - 1)):
  ends = splitted_line[i].endswith('\\')
  if ends:
   splitted_line[i] = splitted_line[i][:(-1)]
  if ((ends or (i >= maxsplit)) and (i < (splitted_line_size - 1))):
   splitted_line[i] = ';'.join([splitted_line[i], splitted_line[(i + 1)]])
   del splitted_line[(i + 1)]
   splitted_line_size -= 1
  else:
   i += 1
 return splitted_line

def split_semicolon ( line , maxsplit = None ) : splitted_line = line . split ( ';' ) splitted_line_size = len ( splitted_line ) if ( ( maxsplit is None ) or ( 0 > maxsplit ) ) : maxsplit = splitted_line_size i = 0 while ( i < ( splitted_line_size - 1 ) ) : ends = splitted_line [ i ] . endswith ( '\\' ) if ends : splitted_line [ i ] = splitted_line [ i ] [ : ( - 1 ) ] if ( ( ends or ( i >= maxsplit ) ) and ( i < ( splitted_line_size - 1 ) ) ) : splitted_line [ i ] = ';' . join ( [ splitted_line [ i ] , splitted_line [ ( i + 1 ) ] ] ) del splitted_line [ ( i + 1 ) ] splitted_line_size -= 1 else : i += 1 return splitted_line
split a line on semicolons characters but not on the escaped semicolons .