Is there a way to save a list in an auxiliary file and then manipulate it directly, without having to download it, manipulate it, and then rewriting the file?

Namely, I would like to be able to do e.g. something like this:

```
L = open('file')
L.append(0)
L.close()

```

What is the correct way to do it? Is there a specific class for it?

---

I solved the problem using `shelve` (a `pickle`-based library) as follows:

```
import shelve

f = shelve.open('list.db',writeback=True)
f['0'] = the list I want
L = f['0']

Manipulate L however I want

f.close()

```