i wanted to know how to use python script with tauri app, i tried a few things but failed i try to take an input from the user using html tag then want to pass it to python and then after the python code does the adding wanted to display the result back in the html page, i got confused how to communicate the two of them(python and javascript) i saved my python script in the same directory as the html but when i click the button there is not response,
this is my python script
num1 = int(sys.argv[1])
num2 = int(sys.argv[2])
result = num1 + num2
print(str(result))
and this is the html part
<html>
<head>
<meta charset="UTF-8">
<title>My Tauri App</title>
</head>
<body>
<label for="num1">Enter number 1:</label>
<input type="number" id="num1">
<label for="num2">Enter number 2:</label>
<input type="number" id="num2">
<button id="addBtn">Add Numbers</button>
<div id="result"></div>
<script>
const { spawn } = require('child_process');
const addBtn = document.getElementById('addBtn');
const num1Input = document.getElementById('num1');
const num2Input = document.getElementById('num2');
const resultDiv = document.getElementById('result');
addBtn.addEventListener('click', () => {
const num1 = parseInt(num1Input.value);
const num2 = parseInt(num2Input.value);
const python = spawn('python', ['add_numbers.py', num1.toString(), num2.toString()]);
python.stdout.on('data', data => {
const result = data.toString().trim();
resultDiv.textContent = `Result: ${result}`;
});
python.stderr.on('data', error => {
console.error(error.toString());
});
});
</script>
</body>
</html>
i saved my python script in the same directory as the html but when i click the button there is not response,