mirror of
https://gitee.com/coder-xiaomo/gitee2github
synced 2025-01-27 11:40:28 +08:00
13 lines
331 B
Python
13 lines
331 B
Python
|
import os
|
||
|
import json
|
||
|
|
||
|
def saveJSON(data, filename):
|
||
|
with open(filename, 'w', encoding='utf-8') as f:
|
||
|
json.dump(data, f, ensure_ascii=False, indent=4)
|
||
|
|
||
|
def readJSON(filename):
|
||
|
with open(filename, 'r', encoding='utf-8') as f:
|
||
|
return json.load(f)
|
||
|
|
||
|
def fileExists(filename):
|
||
|
return os.path.exists(filename)
|