예제 #1
0
def read_file(filepath):
    _filepath = resolve_file_path(filepath)
    if os.path.exists(_filepath):
        fc = open(_filepath, 'r')
        obj = json.load(fc, encoding='utf-8')
        fc.close()
        return obj
    else:
        return None
예제 #2
0
파일: jsonfile.py 프로젝트: zuberv/xceltv
def read_file(filepath):
    _filepath = resolve_file_path(filepath)
    if os.path.exists(_filepath):
        fc = open(_filepath, 'r')
        obj = json.load(fc, encoding='utf-8')
        fc.close()
        return obj
    else:
        return None
예제 #3
0
def write_file(filepath, obj):
    _filepath = resolve_file_path(filepath)
    fc = open(_filepath, 'w')
    status = json.dump(obj, fc, encoding='utf-8')
    fc.close()
    return status
예제 #4
0
파일: jsonfile.py 프로젝트: zuberv/xceltv
def write_file(filepath, obj):
    _filepath = resolve_file_path(filepath)
    fc = open(_filepath, 'w')
    status = json.dump(obj, fc, encoding='utf-8')
    fc.close()
    return status