I have a very simple web page which I'm using in order to rotate a stepper motor on Raspberry Pi. My html file is this:
<html>
<head>
<script Language="Javascript">
function ccw()
{
document.location="cgi-bin/rotate_45_ccw.py";
}
function cw()
{
document.location="cgi-bin/rotate_45_cw.py";
}
</script>
</head>
<body>
<div style="text-align:center">
<h1>Raspberry Pi GPIO</h1>
<br>
<button type="button", id="ccw", onclick="ccw()", value="value CCW">Rotate CCW</button>
<button type="button", id="cw", onclick="cw()", value="value CW">Rotate CW</button>
<br>
</div>
</body>
</html>
What I want to do is after either of the scripts is executed, for the page to be refreshed (so that the user can click again on either button). The dumb way I guess, is for the Python scripts to output the above html code. Is there a smarter/easier way?
Thanks!