Web Analytics Made Easy - Statcounter
Skip to content

PySimpleGUIWeb

Call Reference PySimpleGUIWeb

PySimpleGUIWeb provides a GUI that you access from your browser instead of running an executable. It's based on a framework named REMI (Python REMote Interface library)

Installing

PySimpleGUIWeb is installed via pip.

To install PySimpleGUIWeb you will run:

python -m pip install PySimpleGUIWeb

If you use the command python3 on your computer to invoke Python, then you'll run python3 instead of python:

python3 -m pip install PySimpleGUIWeb

Importing

To use PySimpleGUIWeb, you will use this import statement:

import PySimpleGUIWeb as sg

No Display, No Problem

If you are developing an application on a computer that does not have a display, mouse, keyboard, but still want to be able to control your program then you'll need to use a network connection to communicate with your application. PySimpleGUIWeb enables you to interact with your application over the network interface. An embedded system is a good example of one of these systems.

An example setup could be that you've developed an application that is running on a Raspberry Pi that is controlling your sprinkler system. Rather than using a display directly connected to your Pi, you can communicate with your Pi over your network. On the Pi write your application using PySimpleGUIWeb. When you want to control your application, connect to it from another computer that's running a web browser.

While you're developing your application, you do not have to run PySimpleGUIWeb on another computer. You can run PySimpleGUIWeb on the same computer as your browser. You'll use IP address 127.0.0.1 to connect to your application running locally.

Remi Package Required

Like the other ports of PySimpleGUI that are not tkinter based, the PySimpleGUIWeb port is based on a Python package that is pip installed. If you pip install PySimpleGUIWeb, then the REMI package will automatically be installed.

Not Meant to Serve Web Pages

Multiple simultaneous connections to your application is not something supported using PySimpleGUIWeb. It's not meant to be a web-page server. PySimpleGUIWeb is a graphical user interface for your application just like the other 3 ports of PySimpleGUI. Rather than rendering your user interface on your screen as a "window" that is created by your operating system, with PySimpleGUIWeb your user interface is rendered as a web page in your browser.