-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (16 loc) · 738 Bytes
/
main.py
File metadata and controls
24 lines (16 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from webui import webui
def main():
# Create an instance of a Window object
my_window = webui.Window()
# Open an image file and read it in as byte data.
with open("./webui_python.png", 'rb') as file:
raw_bytes: bytes = file.read()
# Open the window using the html file in the project while getting the appropriate browser for the user.
my_window.show_browser("index.html", my_window.get_best_browser())
#print(raw_bytes)
# Send over the byte data from the picture to the javascript function we have in the html.
my_window.send_raw("myJavaScriptFunc", raw_bytes)
# waits for all windows to close before terminating the program.
webui.wait()
if __name__ == "__main__":
main()