Write Lines To File In Python