Use io module in Py2.x for file I/O