I am trying to write python code where I write to a fileand for each f.write. I want to make it write to a new line. I thought \n would do it. But right now everything is being written to one line. What am I doing wrong ?
Code (localtime, sum and value are variables)
f = open('/var/www/html/index.html','w') f.write("<font size='35px'>"+sum+"</font>") f.write('\n'+localtime) f.write('\n Sist oppdatert '+value) f.close()
\nbeing correctly appended. What's going wrong for you?sum- it's a built in function.