import io

def myfunc(lines):
    """Do something to each line
    Here's an example:
    >>> data = StringIO.StringIO("line 1\\nline 2\\n")
    >>> myfunc(data)
    ['1', '2']
    """
return [line[-2] for line in lines]
if __name__ == '__main__':
    import doctest
doctest.testmod()
What's the Pythonic way to store a data block in a Python script?