Browse Source

Add simple write_file() util func

master
heck 5 years ago
parent
commit
edc21cf269
  1. 4
      gen/gen_cid/utils.py

4
gen/gen_cid/utils.py

@ -15,6 +15,10 @@ def read_file(path):
file_content = f.read() file_content = f.read()
return file_content return file_content
def write_file(path, data):
with open(path, "w+") as f:
f.write(data)
def write_json(content, outpath): def write_json(content, outpath):
# create path if not existing # create path if not existing
out_dir = os.path.dirname(outpath) out_dir = os.path.dirname(outpath)

Loading…
Cancel
Save