Next, we use the create_window method to create and show a native window which renders the content of with the title "Techiediaries".Īll parameters are self explanatory, they just control the width, hieght and other properties of the window. So you first start by importing the webview. create_window ( "Techiediaries", "", width = 800, height = 600, resizable = True, fullscreen = False ) You also need the pip package manager installed then open up your terminal under Linux/MAC or the command prompt under Windows and run: For providing a native windowįirst of all, make sure you have either Python 2 or 3 installed in your development machine. PyWebView doesn't re-invent the wheel but instead it uses the existing tools and native platform APIs. It's in fact a headless web browser that you can use to run a unique and default web app so the user gets the feeling of having an ordinary GUI application. PyWebView is an open source, cross platform and lightweight wrapper which provides you with a WebKit/MSHTML based webview inside a native GUI window which allows you to render HTML and CSS and execute JavaScript code just like any normal web browser. What is PyWebView?īefore getting started with PyWebView let's first introduce it. You can also use any web framework based on python such as the so popular django framework or also the lightweight web development framework flask to build business logic of your app and then wrap the whole app, server and client side, into a desktop app.
Pip install pyqt5 webkit how to#
Have you ever wanted to use your python and web development skills to build cross platform desktop GUI apps? if yes then welcome to this tutorial where we'll show you how to use PyWebView to turn your web application built using python and client side technologies such as HTML, CSS and JavaScript into a standalone cross platform GUI application that runs under major operating systems such as Linux, Windows and MAC.