Is there a way to do this using Python?