2

Every time I need to load a local file using webkit in python I need to start with "file://" which I need to include in all files I am working with. How can I eliminate the need to do that? I want to load files like webview.load_uri('file.html') instead of webview.load_uri('file://file.html')?

0

2 Answers 2

3

You can't. webview.load_uri() takes a string containing a URI. 'file.html' isn't a URI, 'file://file.html' is.

Sign up to request clarification or add additional context in comments.

1 Comment

I just discovered that fact. Thanx
1

webview.load_string() takes the text of an html file. you can load the file into a file object without the file:// and read it into the load_string function.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.