Don't use tape inside an enclosure (it's dangerous for your BP), instead you can use aquarium silicone or hot glue to secure the sensor to the enclosure. I'd recommend hot glue because you can apply it and it cools/bonds quickly so you can take your BP out, secure the sensor/let it cool, and have your ball python back in its enclosure in the least amount of time. Silicone takes 24+ hours to cure so that's probably not your best option since you seem to only have 1 enclosure.