Automating checking for active users with Python