Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Address book
- import pickle
- add = pickle.load(open('/sdcard/Download/dump.txt', 'rb'))
- def man ():
- while True:
- menu = int(input("1) Cauta o adresa\n2)Insereaza o adresa\n3)exit\n:"))
- if menu == 2:
- adaugaAdresa()
- if menu == 1:
- cautaAdresa()
- def cautaAdresa():
- nume = input("Introduce numele complet: ")
- if nume in add.keys():
- print(add[nume])
- def adaugaAdresa():
- nume = input("Introduce numele complet: ")
- adresa = input("Introduce adresa completa: ")
- add[nume] = adresa
- pickle.dump(add, open('/sdcard/Download/dump.txt', 'wb'))
- print (add)
- if __name__ == '__main__':
- man ()
Advertisement
Add Comment
Please, Sign In to add comment