no need to load json string into ram
This commit is contained in:
parent
37cd92dfba
commit
5c1ab13749
1 changed files with 5 additions and 1 deletions
|
@ -275,7 +275,11 @@ def read_file(file, verbose=False):
|
|||
return data
|
||||
|
||||
def read_json(file, verbose=False):
|
||||
return json.loads(read_file(file, verbose=verbose))
|
||||
if verbose:
|
||||
print 'reading', file
|
||||
with open(file) as fd:
|
||||
data = json.load(fd)
|
||||
return data
|
||||
|
||||
def write_file(file, data, verbose=False):
|
||||
if verbose:
|
||||
|
|
Loading…
Reference in a new issue