simulation of C-code target detection in Python