mirror of
https://github.com/allankoechke/pywebview.git
synced 2026-12-02 09:37:30 +00:00
28 lines
657 B
Python
28 lines
657 B
Python
import webview
|
|
import threading
|
|
import time
|
|
|
|
"""
|
|
This example demonstrates how a webview window is created and URL is changed
|
|
after 10 seconds.
|
|
"""
|
|
|
|
|
|
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)
|