MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / getPythonCommand

Function getPythonCommand

test/test-enhanced-repl.js:9–23  ·  view source on GitHub ↗

* Determines the correct python command to use * @returns {string} 'python3' or 'python'

()

Source from the content-addressed store, hash-verified

7 * @returns {string} 'python3' or 'python'
8 */
9function getPythonCommand() {
10 try {
11 // Prefer python3 if available
12 execSync('command -v python3', { stdio: 'ignore' });
13 return 'python3';
14 } catch (e) {
15 // Fallback to python
16 try {
17 execSync('command -v python', { stdio: 'ignore' });
18 return 'python';
19 } catch (error) {
20 throw new Error('Neither python3 nor python command is available in the PATH');
21 }
22 }
23}
24
25
26/**

Callers 1

testEnhancedREPLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected