Skip to content

Instantly share code, notes, and snippets.

@Kristian-Roopnarine
Created September 30, 2019 23:32
Show Gist options
  • Save Kristian-Roopnarine/a3af74e8392b17815bb0da9258a54937 to your computer and use it in GitHub Desktop.
Save Kristian-Roopnarine/a3af74e8392b17815bb0da9258a54937 to your computer and use it in GitHub Desktop.
def read_passwords(self,filename):
if os.path.exists(filename):
with open(filename) as file:
return json.load(file)
else:
data = {}
with open(filename,'w') as outfile:
json.dump(data,outfile)
return data
def save_passwords(self,data,filename):
with open(filename,'w') as file:
json.dump(data,file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment