Skip to content

Instantly share code, notes, and snippets.

@SurendraTamang
Created July 19, 2020 15:43
Show Gist options
  • Save SurendraTamang/95a741f64946cdf19308e2bb4f8c257b to your computer and use it in GitHub Desktop.
Save SurendraTamang/95a741f64946cdf19308e2bb4f8c257b to your computer and use it in GitHub Desktop.
This gist is for updating the json file
with open(self.outputfile, 'r+', encoding="utf-8") as json_file:
load_json_file = json.load(json_file)
load_json_file['link_list'].append(updated_data)
json_file.seek(0)
json_file.write(json.dumps(
load_json_file, indent=2, ensure_ascii=False))
json_file.truncate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment