code: def delete_password(service, username):
          
          try:
              # set up the call for security.
              call = subprocess.Popen(['security',
                                       'delete-generic-password',
                                       '-a',
                                       username,
                                       '-s',
                                       service],
                                      stderr=subprocess.PIPE,
                                      stdout=subprocess.PIPE)
              _, _ = call.communicate()
              code = call.returncode
              # check return code.
              if code is not 0:
                  raise PasswordSetError('Can\'t delete password in keychain')
          except:
              raise PasswordSetError("Can't delete password in keychain")
docs: Delete the password for the username of the service.