welsonjs/lib/python3.js

36 lines
863 B
JavaScript
Raw Normal View History

2022-01-19 04:54:49 +00:00
var SHELL = require("lib/shell");
function PythonObject() {
this.version = "3.10.2-embed";
this.platform = "amd64";
this.setVersion = function(version) {
this.version = version;
};
this.setPlatform = function(platform) {
this.platfrom = platform;
};
2022-01-25 07:49:36 +00:00
this.execScript = function(scriptName, args) {
2022-01-19 04:54:49 +00:00
return SHELL.exec([
"bin\\python-" + this.version + "\\" + this.platform + "\\python",
scriptName
].concat(args));
};
}
exports.PythonObject = PythonObject;
2022-01-25 07:49:36 +00:00
2022-01-19 04:54:49 +00:00
exports.create = function() {
return new PythonObject();
};
2022-01-25 07:49:36 +00:00
exports.execScript = function(scriptName, args) {
return (new PythonObject()).execScript(scriptName, args);
};
2022-01-19 04:54:49 +00:00
exports.VERSIONINFO = "Python Interface (python3.js) version 0.1";
exports.global = global;
exports.require = global.require;