import re import os input_path = 'G:/test/aa.json' output_path ='G:/test/bb.json' with open(input_path) as input_file: str = input_file.read() str = re.sub('s','',str) print str with open(output_path, 'w') as output_file: output_file.write(str)