Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
How to open HTML Files in a Webbrowser
-
Thank you! It works.
-
It's actually not necessary to construct a
file://
URL yourself, you can simply pass an absolute file path (i.e.os.path.abspath('base.html')
) toload_url
, and it'll be converted to a URL internally.Naïvely concatenating
'file://' + path
can lead to problems when your path contains spaces etc. -
@omz I learn every day...
One more time, Thanks for your marvelous application, it has changed my life, really.
I'm retired, I was reading a lot, and now, I almost only use your app.
That's why all my files are now on my iPad, and my Mac is only used as a backup -
This script might help: github
-
@omz
Hello you can u send my a video tutorial how to open pythonista file in google chrome I am a beginner in programming
Thank you -
It works perfect. Thank you.
Is there any way to use external CSS instead internal styles (in the same folder)?!!
-
@dolanskurd This works but I'm not sure that I correctly understand your question, my fault::
base.html<!doctype html> <html> <head> <meta charset="utf-8"> <title>Title</title> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> <h1>Hello</h1> </body> </html>
mystyle.css
body { background-color: lightblue; } h1 { color: navy; margin-left: 20px; }
-
Thanks for prompt replying.
Yes exactly, I meant as the normal way which we are working with HTML & CSS next to each-other and link the CSS file in the HTML file. I have tested it but couldn’t success to link the CSS file to the HTML.As folllows:
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>NOT using styles inside the HTML file.
-
@dolanskurd I don't understand what doesn't work for you.
My little script + Base.html + mystyle.css in the same folder do work.
-
Yesss, I tried it and it works perfect! Thank you.
-
@cvp hi dear cvp
Hi i did run the code u send but the output of my html project is not fullsize..which mean all the margin is ruin due to small webview only?any solution to enlarge the webview for whole screen? -
@shinowtf try
w.present('fullscreen')
-
@cvp tqqqqqqqq!!!