ChatGPT - Python LineReader Implementation