Detect-It-Easy/db/Binary/text.python.1.sg
2024-11-12 20:11:38 +03:00

17 lines
No EOL
372 B
JavaScript
Executable file

// Detect It Easy: detection rule file
init("source", "Python");
function detect() {
var sText = Binary.getHeaderString();
if ((/import\s/.test(sText)) && (/class\s/.test(sText)) && (/self/.test(sText))) {
if (/\sdef\s/.test(sText)) {
bDetected = true;
}
}
_setLang("Python", bDetected);
return result();
}