-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
31 lines (23 loc) · 725 Bytes
/
main.js
File metadata and controls
31 lines (23 loc) · 725 Bytes
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
import {PythonShell} from 'python-shell';
alert("This alert box was called with the onload event");
var pyshell = new PythonShell('main.py');
const blockchain = "bnb";
const address = "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984";
const start_date = "2023-01-23 00:00:00";
const end_date = "2023-01-27 00:00:00";
pyshell.send(JSON.stringify([
blockchain,
address,
start_date,
end_date]));
pyshell.on('message', function (message) {
// received a message sent from the Python script (a simple "print" statement)
console.log(message);
});
// end the input stream and allow the process to exit
pyshell.end(function (err) {
if (err){
throw err;
};
console.log('finished');
});;