Let's say I have a simple Python variable, such as the following:
x = 5
I'd like to create a web page that uses javascript to further process that variable, running on the same computer (a Raspberry Pi).
<!DOCTYPE html>
<html>
<body>
<script>
document.write(x);
</script>
</body>
</html>
Because the Raspberry Pi uses a micro SD card, I would like to limit the number of read/write cycles. Is there a way to store this Python variable in memory (or some other way) which could be accessed by the Javascript code?
I know some will suggest rewriting the Python code in Javascript, but I already have a large Python program that I would prefer NOT to have to rewrite due to time and the original effort involved in its creation. And if you are curious, I'm using the Javascript to display data with Highcharts - which is preferred for my project.