Write Lines To A File In Python