Skip to content
Advertisement

How can I remove a part of the JSON, and can someone explain how It works?

So I’m new to the JSON files, I was trying to make that my python program deletes a JSON “line” when something happens, I got the code that write in the JSON but I don’t know how it works, I would appreciate that someone explains how it works:

JavaScript

And the JSON looks like this:

JavaScript

How could I do to for example if the var guid has 972102908529225758 how can I delete this part? "972102908529225758": "972102909372297228"

Advertisement

Answer

this is like a dictionary so a simple guilds_dict.pop(‘Your key’) would be enough;

How could I do to for example if the var guid has 972102908529225758 how can I delete this part? “972102908529225758”: “972102909372297228”

guilds_dict.pop(‘972102908529225758’);

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement