GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — webview-python/README.md at master · zserge/webview-python

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
72 lines (52 loc) · 1.35 KB
/

README.md

Copy path

File metadata and controls

72 lines (52 loc) · 1.35 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

webview

Python extension that provides API for the webview library.

Getting started

Install the bindings:

pip install webview

Try the following example:

import webview

w = webview.WebView(width=320, height=240, title="Hello", url="https://google.com", resizable=True, debug=False)
w.run()

You may use most of the webview APIs:

# Change window title
w.set_title("New title")
# Make window fullscreen
w.set_fullscreen(True)
# Change initial window background color
w.set_color(255, 0, 0)
# Inject some JS
w.eval("alert('hello')")
# Inject some CSS
w.inject_css('* {background-color: yellow; }')
# Show native OS dialog
file_path = w.dialog(0, 0, "open file", "")
# Post funciton to the UI thread
w.dispatch(some_func)
w.dispatch(lambda: some_func())
# Control run loop
while w.loop(True):
  pass

Dispatch is currently only a stub and is implemented as direct function call. Also, proper Python-to-JS object mapping is not implemented yet, but is highly

Development

To build and install the library locally:

python setup.py install

To upload a new version:

python setup.py sdist
twine upload dist/webview-*.tar.gz

To build and install it locally:

python setup.py install

Please, ensure that all sources are formatted using yapf.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.