python detect script