StringIO
4.6 StringIO -- ファイルのように文字列を読み書きする
http://www.python.jp/doc/release/lib/module-StringIO.html
Chapter 10. Scripts and Streams
http://diveintopython.org/scripts_and_streams/index.html#kgp.openanything.stringio.example
lines = StringIO.StringIO(text) for line in lines.readlines(): templine = line.replace("\n", "")