Write line by line to file python, This is known as creating a script