MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / findPython

Function findPython

src/ast/extract-python.ts:537–553  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

535filename = sys.argv[1] if len(sys.argv) > 1 else '<stdin>'
536print(json.dumps(extract_sqlmodel(source, filename)))
537`;
538
539let pythonAvailable: boolean | null = null;
540let pythonCmd: string = "python3";
541
542async function findPython(): Promise<boolean> {
543 if (pythonAvailable !== null) return pythonAvailable;
544
545 for (const cmd of ["python3", "python"]) {
546 try {
547 const { stdout } = await execFileP(cmd, ["--version"], { timeout: 3000 });
548 if (stdout.includes("Python 3")) {
549 pythonCmd = cmd;
550 pythonAvailable = true;
551 return true;
552 }
553 } catch {}
554 }
555
556 pythonAvailable = false;

Callers 2

runPythonWithStdinFunction · 0.85
isPythonAvailableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected