python extraction program