update20140630

This commit is contained in:
stubbfel
2014-06-30 13:58:10 +02:00
parent 565970632e
commit 1e6cf42df3
877 changed files with 1146249 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
__author__ = 'stubbfel'
import json
import glob
def readJSON(fileName):
with open(fileName, newline='\n') as jsonFile:
jsonObject = json.loads(jsonFile.read())
return jsonObject
def writeJSON(fileName, jsonObject):
with open(fileName, 'w', newline='\n') as jsonFile:
jsonFile.write(json.dumps(jsonObject, indent=4))
jsonFile.close()
def mergeJSON(files, outPutfileName):
mergeObject = {}
for fileName in files:
jsonObject = readJSON(fileName)
mergeObject[fileName] = jsonObject
writeJSON(outPutfileName, mergeObject)
#print (glob.glob("*.json"))
#result = readJSON("test.json")
#writeJSON("boo.json", result)
#mergeJSON(["test.json","boo.json"],"bla.json")