.emacs.d/snippets/python-mode/json-dump

10 lines
216 B
Plaintext
Raw Permalink Normal View History

# -*- mode: python -*-
# name: json-dump
# key: jd
# --
import uuid
import json
f_name = str(uuid.uuid4())
with open(f'~/Documents/$0/{f_name}.json', 'w') as file:
file.write(json.dumps(${1:content}, indent=2))