Python Write To File Line By Line