How to call Shell script or python script in from a Atom electron app

后端 未结 3 1247
孤城傲影
孤城傲影 2020-12-14 19:36

I\'m trying to use the Atom electron to write a Desktop App for both Mac and Windows.

What I need here is :

A button.

And when the user click the but

3条回答
  •  心在旅途
    2020-12-14 20:04

    you could use child_process to archive what you are trying to do by using the following code

    var exec = require('child_process').exec
    function Callback(err, stdout, stderr) {
        if (err) {
            console.log(`exec error: ${err}`);
            return;
        }else{
            console.log(`${stdout}`);
        }
    }
    
    res = exec('ping xxx.xxx.xxx', Callback);
    

提交回复
热议问题