How to use the python-shell.PythonShell.defaultOptions function in python-shell

To help you get started, we’ve selected a few python-shell examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Scony / godot-gdscript-toolkit / editor-plugins / vscode / src / extension.ts View on Github external
export function run_formatter(
    script: string,
    uri: vscode.Uri,
    callback: (result: string[] | undefined) => void
) {
    let options = PythonShell.defaultOptions;
    options.scriptPath = SCRIPT_PATH;

    const pythonPath: string | undefined = vscode.workspace
        .getConfiguration("python")
        .get("pythonPath");
    if (!!pythonPath) {
        options.pythonPath = pythonPath;
    }

    let input = script;

    options.args = PY_ARGS;
    options.args[0] = input;

    PythonShell.run(SCRIPT_NAME, options, (err, results) => {
        if (err) {

python-shell

Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio

MIT
Latest version published 1 year ago

Package Health Score

72 / 100
Full package analysis