Python code for detecting animals using raspberry pi

Python code for detecting monkey using raspberry pi and if it is detected then a signal has to send to power amplifier to generate sound