(self, prompt="")
return line
Returns a single line of input (may be incomplete SQL) from self.stdin.

        If EOF is reached then return None.  Do not include trailing
        newline in return.
Returns a single line of input (may be incomplete SQL) from self.stdin.
Returns a single line of input ( may be incomplete SQL ) from self . stdin .
def getline(self, prompt=""):
        """Returns a single line of input (may be incomplete SQL) from self.stdin.

        If EOF is reached then return None.  Do not include trailing
        newline in return.
        """
        self.stdout.flush()
        self.stderr.flush()
        try:
            if self.interactive:
                if self.stdin is sys.stdin:
                    c = self.colour.prompt, self.colour.prompt_
                    if self._using_readline and sys.platform != "win32":
                        # these are needed so that readline knows they are non-printing characters
                        c = "\x01" + c[0] + "\x02", "\x01" + c[1] + "\x02",
                    line = self._raw_input(c[0] + prompt + c[1]) + "\n"  # raw_input excludes newline
                else:
                    self.write(self.stdout, prompt)
                    line = self.stdin.readline()  # includes newline unless last line of file doesn't have one
            else:
                line = self.stdin.readline()  # includes newline unless last line of file doesn't have one
            self.input_line_number += 1
            if sys.version_info < (3, 0):
                if type(line) != unicode:
                    enc = getattr(self.stdin, "encoding", self.encoding[0])
                    if not enc: enc = self.encoding[0]
                    line = line.decode(enc)
        except EOFError:
            return None
        if len(line) == 0:  # always a \n on the end normally so this is EOF
            return None
        if line[-1] == "\n":
            line = line[:-1]
        return line
def getline ( self , prompt = "" ) : self . stdout . flush ( ) self . stderr . flush ( ) try : if self . interactive : if self . stdin is sys . stdin : c = self . colour . prompt , self . colour . prompt_ if self . _using_readline and sys . platform != "win32" : # these are needed so that readline knows they are non-printing characters c = "\x01" + c [ 0 ] + "\x02" , "\x01" + c [ 1 ] + "\x02" , line = self . _raw_input ( c [ 0 ] + prompt + c [ 1 ] ) + "\n" # raw_input excludes newline else : self . write ( self . stdout , prompt ) line = self . stdin . readline ( ) # includes newline unless last line of file doesn't have one else : line = self . stdin . readline ( ) # includes newline unless last line of file doesn't have one self . input_line_number += 1 if sys . version_info < ( 3 , 0 ) : if type ( line ) != unicode : enc = getattr ( self . stdin , "encoding" , self . encoding [ 0 ] ) if not enc : enc = self . encoding [ 0 ] line = line . decode ( enc ) except EOFError : return None if len ( line ) == 0 : # always a \n on the end normally so this is EOF return None if line [ - 1 ] == "\n" : line = line [ : - 1 ] return line