Files
pywebview/examples/open_file_dialog.py
Roman Sirokov 99e3974c92 New API
Cocoa implementation
Revamped tests and examples
2019-04-28 17:07:08 +03:00

18 lines
497 B
Python

import webview
import threading
"""
This example demonstrates creating an open file dialog.
"""
def open_file_dialog(window):
file_types = ('Image Files (*.bmp;*.jpg;*.gif)', 'All files (*.*)')
result = window.create_file_dialog(webview.OPEN_DIALOG, allow_multiple=True, file_types=file_types)
print(result)
if __name__ == '__main__':
window = webview.create_window('Open file dialog example', 'https://pywebview.flowrl.com/hello')
webview.start(open_file_dialog, window)