Write Lines Method In Python