2

I've written python scripts for some numerical analysis topics and so I want to plot them in a nice way using any Java Script library.

So, I got to know about python-node and they show some brief doc info at that site:

var python = require('node-python');
var os = python.import('os');

// nodejs stuff
var path = require('path');

assert(os.path.basename(os.getcwd()) == path.basename(process.cwd()))

However, how could I start to actually do python, import python libraries, run python scripts, etc?

diegoaguilar
  • 8,179
  • 14
  • 80
  • 129

1 Answers1

1

That example show how to use import and call functions.

Try following:

var python = require('node-python');
var script = python.import('your_script_module_name');

script.your_function(argument1, argument2)
falsetru
  • 357,413
  • 63
  • 732
  • 636