Updates from the Repl.it team about the product

← Back to all posts
13
PySimpleGUI Adds Support For Repl.it
amasad (1223)

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.

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)

https://repl.it/@amasad/PySimpleGUI

Commentshotnewtop
2
PaoloAmoroso (62)

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.

2
PaoloAmoroso (62)

That's beyond awesome. Thanks!

1
glench (34)

@amasad When I try to use this repl I keep getting what looks like a loading screen whenever I do something. Can't actually try the app:

1
amasad (1223)

@glench the problem with REMI is that by default it's not shared instance across all users. There's, however, a way to make it multi instance. I'll ask the PySimpleGUI folks to make it multi instance.

For now, fork it.

1
glench (34)

@amasad Same thing seems to happen even after I fork it. In Chrome it reloads slowly, and in Safari it just keeps reloading continuously:

1
DavideRosa (29)

@glench possible causes:

  • slow internet connection
  • old browser
  • cookies disabled
1
glench (34)

@DavideRosa oh huh! I have the most recent Chrome (beta) and Safari and my internet is fast. In Chrome I have 3rd party cookies disabled and in Safari I have what looks like default setting of cookies enabled from websites I visit.

1
glench (34)

@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.

1
DavideRosa (29)

@glench I don't know what does __repl appended at the end of the url. however I will give you some more info tomorrow, now it's late night here ;-)

1
DavideRosa (29)

@glench avoid to use __repl url since it tries to make http request to the same server, but from a different url, and this is not allowed. fork it access the standard url . Consider also that there is a graphical gui editor http://remiguieditor--daviderosa.repl.co/ .

1
glench (34)

@DavideRosa I mean, I wanted to use the __repl to see and modify the source. Even when I forked it it didn't work :(

1
DavideRosa (29)

@glench I opened your fork and it works. It starts at this address "https://remiexample-1.glench.repl.run" and from here we can se the console output. then if I change the url to "https://remiexample-1.glench.repl.co" I can see the UI page correctly.

2
glench (34)

@DavideRosa Yeah, but it doesn't work in the repl.it IDE/editor, which is the bug I'm reporting.

1
PySimpleGUI (6)

@amasad

I've added an option to the Window call in PySimpleGUI to turn on / off the multi-instance option. I tried setting it to ON as a default and it REALLY struggled on repl.it.
So, in version 0.15.0, I turned it back off again, but left the option for others to turn it on.

1
amasad (1223)

@PySimpleGUI thanks. Can you tell me a bit about the struggle? Maybe we can fix ir

1
PySimpleGUI (6)

@amasad You can try this program
https://repl.it/@PySimpleGUI/timerpy
to see the difference in the setting. I was unable to change the behavior now that I've tried again.

The setting to modify is on line 14:
web_multiple_instance=False

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.

1
amasad (1223)

@PySimpleGUI That's because Remi relies on browser cookies. Try incognito window or a seperate browser.