This looks quite interesting >>
https://www.anaconda.com/blog/pyscript-p...he-browser
Runs OK on a laptop - is there a webserver already installed in the openplotter image? Couldn't find apache so installed it, seems to work
https://www.anaconda.com/blog/pyscript-p...he-browser
Runs OK on a laptop - is there a webserver already installed in the openplotter image? Couldn't find apache so installed it, seems to work
Code:
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<b><p>Today is <u><label id='today'></label></u></p></b>
<br>
<div id="pi" class="alert alert-primary"></div>
<py-script>
import datetime as dt
pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y'))
def wallis(n):
pi = 2
for i in range(1,n):
pi *= 4 * i ** 2 / (4 * i ** 2 - 1)
return pi
pi = wallis(100000)
pyscript.write('pi', f'π is approximately {pi:.3f}')
</py-script>
</body>
</html>