Skip to content

Instantly share code, notes, and snippets.

@cbscribe
Created December 7, 2020 00:30
Show Gist options
  • Save cbscribe/ae0bbd63211dd6f79be2c334c118531b to your computer and use it in GitHub Desktop.
Save cbscribe/ae0bbd63211dd6f79be2c334c118531b to your computer and use it in GitHub Desktop.
file i/o example
save_file = "passwords.txt"
logins = {}
customer = {"name": "google", "email": "[email protected]"
def save_data():
with open(save_file, "w") as f:
f.write(str(d))
def load_data():
with open(save_file, "r") as f:
data = f.read()
return eval(data)
logins = load_data()
user = input("usernam: ")
pw = input("pw: ")
if user in logins and pw == logins[user]:
print("valid login")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment