File: change_url.md

package info (click to toggle)
python-pywebview 2.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,376 kB
  • sloc: python: 3,816; cs: 116; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Change URL

Change URL ten seconds after the first URL is loaded.

``` python
import webview
import threading
import time


def change_url():
    # wait a few seconds before changing url:
    time.sleep(10)

    # change url:
    webview.load_url("https://pywebview.flowrl.com/hello")


if __name__ == '__main__':
    t = threading.Thread(target=change_url)
    t.start()

    # Create a non-resizable webview window with 800x600 dimensions
    webview.create_window("URL Change Example",
                          "http://www.google.com",
                          width=800, height=600,
                          resizable=True)
```