Here in index.ts, I've spawned in the script using child_process and am wondering how I can specify which Python version should be ran with it, since it defaults to 2.7 (the one that came with my mac), rather than Python 3.9.6(64-bit) which is my chosen interpreter within vscode.
import { spawnSync } from 'child_process';
const write_questions = spawnSync('python', ['src/write_questions.py', subject], {stdio: 'inherit'})
This command doesn't work because of the Python version being outdated and not including f-strings, however, it does work on another machine of mine without 2.7 on it at all:
basic_addition_file.write(f"What is {basic_addition_first} + {basic_addition_second}?: \ {basic_addition_answers}")
result of checking python version:
print(sys.version)
2.7.16 (default, Jun 18 2021, 03:23:53)