Without a doubt, you've seen a clock like this in demos of HTML5
However, right click and view the source of this page...
The gallery highlights a few of the possibilities, from creating simple document elements to drag and drop and 3D navigation
If the Python program is large, another option is to write it in a separate file, and to load it using the src attribute of the script tag :
Please note that in this case the Python script will be loaded through an Ajax call : it must be in the same domain as the HTML page
In the above two examples of code, when we click on the button, the onclick event calls and run the echo() function, which was defined in the Python script. This function gets the value of the INPUT element, through its id (zone). This is accomplished by the syntax doc["zone"] : doc is a keyword in Brython, which behaves just like a dictionary whose keys are the ids of the elements of the DOM. Hence, in our example, doc["zone"] is an object that maps to the INPUT element ; the value property holds, interestingly enough, the value of the object
In Brython, the output can be accomplished in various ways, including with the alert() built-in function which shows a popup window with the text passed as an argument