def inputMultilineStatement(self): readLines = [] prompt = self.prompt1 while True: readLine = input(prompt).rstrip() if len(readLine) == 0: break lastChar = readLine[-1] if lastChar == ':' and len(readLine) > 1: readLine += '\n' elif lastChar == '\\': readLine = readLine[:-1] readLines.append(readLine) if len(readLine) <= 1 or lastChar not in CONTINUATION_LINE_CHARS: break prompt = self.prompt2 return ''.join(readLines)