1

It is possible to make a web page reload using the pywebview library? I mean, I have this code:

import webview

webview.create_window('Woah dude!', 'index.html')
webview.start(http_server=True)

…and I want to reload the web page every five seconds because changes are being made in the HTML file.

Daniel Werner
  • 1,350
  • 16
  • 26
Asibusa
  • 31
  • 3

1 Answers1

2

Try to do this:

import webview
import time

def reload(window):
    while True:
        time.sleep(5)
        window.load_url('index.html')
        
        
if __name__ == '__main__':
    window = webview.create_window('hello', 'index.html')

    webview.start(reload, window, http_server=True)

        

This will 'reload'the page each 5 seconds. It's not really reloading it, it is basically loading the same url, so it should work.

Asibusa
  • 31
  • 3