So, after reading many instances of this same question being answered, I'm still stuck. Why is this function not writing on a new line every time?:
def addp(wrd,pos):
with open('/path/to/my/text/file', 'w') as text_file:
text_file.write('{0} {1}\n'.format(wrd,pos))
It would seem as though the \n
should be doing the trick. Am I missing something?
I'm running Ubuntu 15.04