-
Notifications
You must be signed in to change notification settings - Fork 23
/
main.js
33 lines (21 loc) · 690 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const {app, BrowserWindow} = require('electron')
function createWindow () {
window = new BrowserWindow({width: 800, height: 600})
window.loadFile('index.html')
/*var python = require('child_process').spawn('python', ['./hello.py']);
python.stdout.on('data',function(data){
console.log("data: ",data.toString('utf8'));
});*/
var pyshell = require('python-shell');
pyshell.run('hello.py', function (err, results) {
if (err) throw err;
console.log('hello.py finished.');
console.log('results', results);
});
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})