this is my code that Im trying to get to write into a JSON file in the format {"Example1": "Example"} Im getting an error which reads:
db_file.write(json.dump({"Admin": keyPass}, db_file)) TypeError: must be str, not None
For this code:
keyPass = input("Create Admin Password » ")
with codecs.open(os.path.join(PATH), 'w') as db_file:
db_file.write(json.dump({"Admin": keyPass}, db_file))
This is the weird part, it creates it in the file fine and how I want it to be formatted is correct, yet it still comes up with the error above.
Could anyone please help me with what I need to correct here?