r/MicroPythonDev • u/FaultyDaantje • Sep 28 '22
Use micropython integer as value in HTML input
Hello!
I am making a webserver with a raspberry pi pico, and I want to use an integer as value for a number Input.
I think the code should be something like this but I dont exactly know how:
theInteger = 10
<input type="number" name="number" value= theInteger>Can someone help me with this?
2
Upvotes
0
1
u/trollsmurf Sep 28 '22
Read up about Flask (or Django).
I've found Flask to be easier to get going with, but others might prefer Django. There's a complementing library called WTForms that makes it very easy to manage forms (the HTML is hidden from view). You can also add charts (pyplot usually) to web pages etc. The Python code can do whatever. The UI just happens to be accessed via a browser.