Call python script from svg-editor.js #590
Unanswered
michaelliesenberg
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Have you already tried to find a solution outside svgedit? I'm not sure you can spawn a python process from a browser. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
i want to call my python script in svg-editor.js file like this:
const clickRun = function () { if (toolButtonClick('#tool_run')) { const spawn = require("child_process").spawn; const pythonProcess = spawn('python', "path/to/script.py"); pythonProcess.stdout.on('data', (data) => { // Do something with the data returned from python script }); } };
But i get an error "Uncaught ReferenceError: require is not defined"
What do i need to do to make it work?
Beta Was this translation helpful? Give feedback.
All reactions