GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-readability/readability/browser.py at master · ArchClass/python-readability Expand file tree/ Copy pathbrowser.pyMore file actions 21 lines (20 loc) · 652 Bytes / Copy pathbrowser.pyFile metadata and controls21 lines (20 loc) · 652 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 def open_in_browser(html): """ Open the HTML document in a web browser, saving it to a temporary file to open it. Note that this does not delete the file after use. This is mainly meant for debugging. """ import os import webbrowser import tempfile handle, fn = tempfile.mkstemp(suffix=".html") f = os.fdopen(handle, "wb") try: f.write(b"<meta charset='UTF-8' />") f.write(html.encode("utf-8")) finally: # we leak the file itself here, but we should at least close it f.close() url = "file://" + fn.replace(os.path.sep, "/") webbrowser.open(url) return url |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |