myfile = open('out.txt', 'a')
myfile.write(caption)
I write something like this whenever my script is run. But after the first run, it keeps on adding same data to the file. How can I check if it's empty or not and tell it to write only if it's empty?