0ADMods / millenniumad

Millennium A.D. is a mod for 0 A.D. covering the AD 500–1000 timeframe.
http://wildfiregames.com/forum/index.php?showforum=297
GNU General Public License v2.0
35 stars 18 forks source link

properly format json data files #56

Closed Nescio0 closed 4 years ago

Nescio0 commented 4 years ago

Here is the script used:

# @fatherbushido 2020-01-18
import json
import glob
for file in glob.glob("simulation/data/**/*.json", recursive=True):
    with open(file, 'r') as f:
        j = json.load(f)
        with open(file, 'w') as f:
            f.write(json.dumps(j, indent="\t", ensure_ascii=False))
            f.write("\n")