How to get the elements inside a boundingbox?

I wrote this in another topic: How to make a pyton script work with a list as input