PySimpleGUI Adds Support For Repl.it
PySimpleGUI, the simplest cross-platform Python GUI framework just added support for Repl.it (web in general) and it's the simplest way I've seen UI being done on Repl.it yet.
This file cannot be displayed: https://storage.googleapis.com/replit/images/1548743581870_2040a56b3c7ca4c642ccd97e9a4df3d1.gi
It has good autocompletion and it's well-documented. It's especially great for new coders that want to try their hands at coding GUI.
To get started simply import the library, create a window, and give it a layout! Here is a name reading app and repl:
import PySimpleGUIWeb as sg window = sg.Window('hello world').Layout([ [sg.Text('hello world')], [sg.InputText('enter name')], [sg.Submit(), sg.Cancel()] ]) [button, [name]] = window.Read() if button == 'Submit': print('Hello ' + name)
I've looked into PySimpleGUI a bit more and I love it. The library is simple to use but provides lots of features for more advanced needs, the documentation is excellent, and the developer is active and enthusiastic.
REMI, the foundation of PySimpleGUIWeb, is amazing too. I hope it soon adds more advanced PySimpleGUI features such as the elements required for supporting Matplotlib, which is already accessble from PySimpleGUI.
Huge thanks to MikeB, the REMI folks, and Repl.It. It's mind-blowing what can be done in the cloud.
@DavideRosa Works fine in Safari and Chrome (although video won't play probably due to 3rd-party cookies being disabled).
However, when I go to http://remiexample--daviderosa.repl.co/__repl it works in Safari but then fails when I tried to fork it. In Chrome when I go to the __repl url it fails both viewing your project and forking my own version.
The setting to modify is on line 14:
This changes the Remi multiple_instance setting which someone suggested as a fix to a problem. I find regardless of the setting, if I open 2 repl.it copies, in 2 different browsers, they sync up and show identical things. When one pauses, so does the other.
On my machine at home this technique actually works quite well but when I tried it on repl.it I discovered that repl.it intercepts the port requested and replaces it (usually with port 80 or 443 it looks like).
So I don't know if that is an easy thing or a near-impossible thing under repl.it, but if you could allow different ports to be used, then it would allow multiple users per repl in these situations instance.
Partly what I'm thinking of here is easy of use for certain potentially nice online apps. Technical people are going to have no problem with "fork it, then reload the page" but if the average joe can just go to a page and start clicking it usually works better for them.