Skip to content

Running python modules #7

@steveoh

Description

@steveoh

in order to run python -m mymodule using python shell I had to bend the expectations on how it is used.

        var shellOptions = {
            scriptPath: 'press',
            cwd: __dirname + '/scripts',
            pythonOptions: ['-m']
        };

        PythonShell.run('', shellOptions, function (err) {

I had to set the scriptPath to be the module name, I then had to set the cwd to be the path to the module, and setting the pythonOptions for -m was pretty normal. When running this module, I had to pass an empty string to PythonShell.run.

Am I abusing this or is it just not designed to work friendly with modules?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions