import os
import json
import re


val = int(input("Welcher wert soll gesetzt werden?: "))
pattern = re.compile("([a-zA-Z])+(.json)")
for filename in os.listdir():
    print(filename)
    if pattern.match(filename):
        
        file = open(filename, 'br')
        data = json.load(file)
        file.close()
        for key, value in data["Stock"].items():
            data["Stock"][key] = val
        file = open(filename, 'w')
        fancy = json.dumps(data, indent=2)
        print(fancy)
        file.write(fancy)
        #json.dump(data, file)
        file.close()
