Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

teamcarma/node-python-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carma Carma IOS Carma Android

Node Python Runner

A library that allows you to execute python code

Install

npm install python-runner -g

The only dependencies of this package are:

## Usage

The execution function will run send every command to the python stdin interpreter returning a Q promise. This will be resolved with the stdout of the python binary.

The python binary will be executed with the same environment variables as its parent process.

You can tweak the following options:

  • bin - The python binary to be used
  • env - Replace the environment variables for this python execution. Useful for PYTHONPATH, ...
var python = requrie("python-runner");

python.exec(
	"print('Carma Carpooling - Get there together')",
	{
		/// set which version of python to use
		bin: "python",
		env: {

			/// set the PYTHONPATH of the current execution
			PYTHONPATH: "...."

		}
	})
	/// get the stdout
	.then(function(stdout){

	})
	/// catch the error
	.then(function(err){

	});

Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published