Good day everyone,
Through recommendation of this community, I have install shelljs such as npm install shelljs --save
into my app folder.
Now I am working out on how to implement it in my nodejs file.
Below is my nodejs file
var express = require('express');
var router = express.Router();
var COMPORT = 5;
var command = 'option1';
Below this i would like to include my python script
import serial
ser = serial.Serial()
ser.baudrate = 38400 #Suggested rate in Southco documentation, both locks and program MUST be at same rate
// COMPORT is a variable that stores an integer such as 6
ser.port = "COM{}".format(COMPORT)
ser.timeout = 10
ser.open()
#call the serial_connection() function
ser.write(("%s\r\n"%command).encode('ascii'))
Hence, my question is how do you include this python script with the variables defined in nodejs included in the script in the same file as the nodejs.
This app that runs on nodejs will be package as an executable desktop app via electron.