Show HTML in Python application and handle click - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Show HTML in Python application and handle click (/thread-35089.html) |
Show HTML in Python application and handle click - SamHobbs - Sep-28-2021 I know how to do this using C#. C# has a WebBrowser class and later classes. I want to show a HTML file in a Python application, not in a browser (not in the usual manner) and process a click event locally in Python. The reason I need to do that is that copying to the clipboard is highly restricted in browsers. Doing this would require a Python module that hosts the browser in the application; that is how Microsoft does it for the WebBrowser class and such. In the past I researched something like that (not using Python) but I forget if I found much. I am trying to avoid being unnecessarily detailed so I apologize if I am not clear. Does something such as that exist for Python? If so then what? Oh, yeah; I forgot about IronPython. I could probably use it if I can get it to work in my system. Update: I got IronPython to work so I will try it. RE: Show HTML in Python application and handle click - snippsat - Sep-28-2021 (Sep-28-2021, 04:19 AM)SamHobbs Wrote: I want to show a HTML file in a Python application, not in a browser (not in the usual manner) and process a click event locally in PythonLook at pywebview, Flexx,and can search electron python .GUI toolkit Like PyQt(Webkit) and WxPython(WebView)has build support for render HTM/CSS. (Sep-28-2021, 04:19 AM)SamHobbs Wrote: The reason I need to do that is that copying to the clipboard is highly restricted in browsers.Yes,but would look into this is really needed maybe and other way, then i would use more normally web-development approach eg for me this would be using Flask. RE: Show HTML in Python application and handle click - SamHobbs - Sep-28-2021 Flask might be useful if I wanted to develop an application; multiple pages that work together. I just need to support one page; the equivalent of using HTML as a word-processing format and Python for the macros. Flexx is by its definition also for applications. Opinion: I think some day the internet will get a new design that allows internet applications to work more like desktop applications; I think desktop applications that work like internet applications are the wrong direction, although the compatibility/portability issue is useful. Javascript API | pywebview appears to be an example of what I need to do. The example in RkBlog :: WebKit in PyQt - rendering web pages also appears relevant. wx.html2.WebView — wxPython Phoenix 4.1.2a1 documentation says it can be built to use Chromium (the current) Edge and that can be useful. So all of those are possibilities. |