I've written a script in python which is able to fetch the title of different posts from a webpage and write them to a csv file. As the site updates it's content very frequently, I like to append the new result first in that csv file where there are already list of old titles available.

I've tried with:

```
import csv
import time
import requests
from bs4 import BeautifulSoup

url = "https://stackoverflow.com/questions/tagged/python"

def get_information(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.content, 'lxml')
    for title in soup.select(".summary .question-hyperlink"):
        yield title.text

if __name__ == '__main__':
    while True:
        with open("output.csv","a",newline="") as f:
            writer = csv.writer(f)
            writer.writerow(['posts'])
            for items in get_information(url):
                writer.writerow([items])
                print(items)

        time.sleep(300)

```

The above script which when run twice can append the new results after the old results.

Old data are like:

```
A
F
G
T

```

New data are `W`,`Q`,`U`.

The csv file should look like below when I rerun the script:

```
W
Q
U
A
F
G
T

```

***How can I append the new result first in an existing csv file having old data?***