Created
December 7, 2020 00:30
-
-
Save cbscribe/ae0bbd63211dd6f79be2c334c118531b to your computer and use it in GitHub Desktop.
file i/o example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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