Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from notifypy import Notify
- notification = Notify()
- usernames = []
- while True:
- prompt = input("> ")
- if prompt.startswith("add"):
- command = prompt[4:]
- usernames.append(command)
- print(usernames)
- elif prompt.startswith("remove"):
- command = prompt[7:]
- if command in usernames:
- usernames.remove(command)
- print(usernames)
- else:
- print("This username does not exist in the list.")
- elif prompt.startswith("replace"):
- command = prompt[8:]
- if command not in usernames:
- print("This user does not exist in the list. ")
- continue
- else:
- pass
- new_val = input("with: ")
- usernames.remove(command)
- usernames.append(new_val)
- print(usernames)
- print("")
- notification.title = 'Replaced Complete'
- notification.message = "Successfully replaced " + str(command) + " with " + str(new_val)
- notification.send()
- elif prompt == "list":
- print(usernames)
- elif prompt.startswith("exit"):
- break
- else:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement