2021-02-25

How to append to simple JSON object in a file? [duplicate]

My JSON resource is out and I'm trying to fill in the gaps, so bear with me, as I don't quite know the terminology here. I'm working to update the worlds simplest JSON File in Python.

Current a.json:

{"quarters": ["Q2-2019", "Q3-2019", "Q4-2019", "Q1-2020", "Q2-2020", "Q3-2020", "Q4-2020",
              "Q1-2021"]}

I'm looking to append to this, with a result of

{"quarters": ["Q2-2019", "Q3-2019", "Q4-2019", "Q1-2020", "Q2-2020", "Q3-2020", "Q4-2020",
              "Q1-2021", "Q2-2021"]}

I can't seem to find a way to quickly add within the quarters "tag". I've been able to create new "tags", but that's not my intent here.



from Recent Questions - Stack Overflow https://ift.tt/2ZN9nbB
https://ift.tt/eA8V8J

No comments:

Post a Comment