title: Bottle Websockets Example That Updates Every Few Seconds
body: <p>As I'm trying to understand websockets with a minimum of javascript knowledge I'm running into major holes in my understanding. A clean example seems like
  <a href="https://bottlepy.org/docs/dev/async.html" rel="nofollow noreferrer">Bottle websockets example</a></p>
  
  <p>and the websockets server and client example there work for me. But I wanted to for example have the time update every 10 seconds on the HTML client. So I just did in the server. </p>
  
  <pre><code>while True:
      wsock.send("Time: " + str(datetime.datetime.now()))
      time.sleep(10)
  </code></pre>
  
  <p>The time shows once but never updates. Trying to do this for a Raspberry Pi project I came across a nodejs example which update sensor values; in this eample there's some Jquery code which I thought I could adapt to the HTML file code in the Bottle example...They are using Jquery .data to "hook into" a table element perhaps that updates.
  <a href="http://www.bonebrews.com/ds18b20-temperatures-in-your-browser/" rel="nofollow noreferrer">NodeJS Updating weosockets example</a></p>
  
  <p>But I can't make the leap to adapt that Jquery "pattern" to Bottle. If someone had the time for just a snippet perhaps it would become obvious. Thanks.</p>