def login(username, passwd): try: u = Academic(username) if u.authenticates(passwd): return u.login() except: return False