1from __future__ import print_function 2import glob 3import os.path 4for path in glob.glob( '*.json' ): 5 text = file(path,'rt').read() 6 target = os.path.splitext(path)[0] + '.expected' 7 if os.path.exists( target ): 8 print('skipping:', target) 9 else: 10 print('creating:', target) 11 file(target,'wt').write(text) 12 13