Browse Source

Merge pull request #5 from Salil03/master

Update python path.
Marcelo Fornet 5 years ago
parent
commit
5989d24ab9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/gwen.ts

+ 3 - 1
src/gwen.ts

@@ -1,13 +1,15 @@
 import { openSync, writeSync } from "fs";
 import { spawnSync } from "child_process";
+import * as vscode from 'vscode';
 import { TESTCASES } from "./core";
 import { join } from "path";
 
 const DEFAULT = 'import random\n\nprint(random.randint(1, 100))\n';
 
 export function create(problemPath: string, outputPath: string) {
+    let python_path: string | undefined = vscode.workspace.getConfiguration('acmx.execution', null).get('pythonPath');
     let tcPath = join(problemPath, TESTCASES);
-    let exitCode = spawnSync("python3", ["-m", `tcgen`, "--path", `${tcPath}`, "--output", `${outputPath}`]);
+    let exitCode = spawnSync(python_path, ["-m", `tcgen`, "--path", `${tcPath}`, "--output", `${outputPath}`]);
 
     console.log("exticode:", exitCode);