Load images dynamically. #1208
Answered
by
r0x0r
TomSchimansky
asked this question in
Q&A
-
When I create a window like this and try to add an image its not working: import webview
def insert_image():
path = "img.jpg"
window.evaluate_js(f"img = document.createElement('img');" +\
f"img.src = '{path}';" +\
f"document.getElementById('body').appendChild(img);\n")
window = webview.create_window(html=f"<html><head></head><body></body></html>")
webview.start(insert_image) How does the path have to look like? the image is in the same folder as the python script. It's also not working with the full path. Also I don't want to use an extra html file for creating the basic window, I want to work with a single .py file and add the content dynamically. |
Beta Was this translation helpful? Give feedback.
Answered by
r0x0r
Sep 6, 2023
Replies: 1 comment
-
There is no access to file system when you load HTML dynamically. You have several choices
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TomSchimansky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no access to file system when you load HTML dynamically. You have several choices