Detect-It-Easy/db/Binary/source_text.python.1.sg
2026-06-20 22:32:01 +02:00

19 lines
No EOL
430 B
JavaScript
Executable file

// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>
// https://www.python.org/
meta("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;
}
}
sLang = "Python";
return result();
}