I have written a small Python script which utilizes `speedtest-cli` to get my internet speed every so often. I am planning to create a contraption where my Python script stores the speed data in a JSON array file that already exists on the disk and then have a small webpage setup to view the data. 

Anyways, I have configured my script in such a way that it spits out a `dict` at the end of the script that looks like this:

```
{
    "downSpeed": 90.30834444821808,
    "humanTime": "Fri Dec  9 18:02:54 2016",
    "time": 1481328174225.999,
    "upSpeed": 13.698571043448549
}

```

I have a JSON file on the disk that is simply a file with two brackets to represent a JSON array and within that array, I want my script to put the `dicts` in the JSON array, separated by commas to represent the `dicts` as `objects` in JSON. My question is how would I go about entering my data into the JSON file? All the solutions that I have come across have mentioned using the `open` function alongside the `a` option. But, there are a couple of issues with this, first off, the data is being appended to the file and the last bracket of the JSON gets cut off because the data is being appended. Secondly, since I plan to run this script pretty frequently, I am afraid that I will run into an issue where the JSON file will be very long and therefore take a very long time for the script to process. So, what are my options here? Is there another way to insert a `dict` into a JSON array (which I guess loosely translates into a `list` in Python)?