-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
33 lines (32 loc) · 1010 Bytes
/
test.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
33
const {PythonShell}=require('python-shell')
const connect = require('./utils/Message')
const script=require('./utils/script')
connect.receieve((msg)=>{
console.log(msg);
})
script('E:/tif/散射强度.tiff').then(res=>{
console.log(res);
})
// let pyshell = new PythonShell('main.py',{
// args:['E:/tif/散射强度.tiff','E:/tif/out',undefined]
// });
// // sends a message to the Python script via stdin
// let per=0
// pyshell.on('message', function (message) {
// if(/^\d/.test(message)){
// message=message.split(' ').slice(0,3).join("");
// if(per<50){
// per=50*eval(message)
// }else{
// per=50+50*eval(message)
// }
// console.log(parseInt(per));
// }
// });
// // end the input stream and allow the process to exit
// pyshell.end(function (err,code,signal) {
// if (err) throw err;
// console.log('The exit code was: ' + code);
// console.log('The exit signal was: ' + signal);
// console.log('finished');
// });