def frame2string(frame):
    """Return info about frame.

    Keyword arg:
        frame

    Return string in format:

    File {file name}, line {line number}, in 
    {name of parent of code object} {newline}
    Line from file at line number
    """

    lineno = frame.f_lineno  # or f_lasti
    co = frame.f_code
    filename = co.co_filename
    name = co.co_name
    s = '\tFile "{0}", line {1}, in {2}'.format(filename, lineno, name)
    line = linecache.getline(filename, lineno, frame.f_globals).lstrip()
    return s + '\n\t\t' + line
Return info about frame.

    Keyword arg:
        frame

    Return string in format:

    File {file name}, line {line number}, in 
    {name of parent of code object} {newline}
    Line from file at line number