3

I'm loving the new pysimplegui tools, and have just started exploring the pysimpleguiweb port but have quickly hit a roadblock. To actually deploy an application built using the web version, it would be important to be able to control what port number the service was hosted on but it currently looks like it finds a random free port.

Looking through the source code on github I found where the remi server is started, it just specifies port=0.

remi.start(self.MyApp, title=self.Title ,debug=False, address='0.0.0.0', port=0, ...  

I guess I can just hack together my own patched version that allows me to specify a port number but I was wondering if there was something obvious I was missing.

  • Feel free to post on an Issue requesting this value be exposed as an Issue on the GitHub site and I'll make sure it gets done. Glad you're liking it. The Web port is SUPER early. – Mike from PSG Feb 24 '19 at 23:14
  • Were you able to install the latest from PyPI to get to the settings you are looking for? I tried to make the changes for you and jam them out as a release as soon as I could. If worked out OK, would be great to indicate the question was answered. If not, please let me now what went wrong. – Mike from PSG Feb 26 '19 at 19:16
  • Sorry have been out of town a couple of days. I pulled the change directly off github and it works great, thank you! I have marked your response as answered, but unfortunately I don't have enough reputation points for the upvote to display. Thanks again. – Paul Baumgarten Feb 28 '19 at 20:02

1 Answers1

2

I have made changes to PySimpleGUIWeb on the GitHub site. You will need to download the file PySimpleGUI.py file from here to get these changes. The changes expose all of the parameters to the Remi Startup call. In your call to PySimpleGUI.Window, you'll now find these additional named parameters and their defaults:

web_debug=False, web_ip='0.0.0.0', web_port=0, web_start_broswer=True, web_update_interval=.00001 

These should give you the level of control you are looking for

These changes have been released to PyPI as PySimpleGUIWeb version 0.11.0. Enjoy! You can get them by doing a pip install:

pip install --upgrade PySimpleGUIWeb

Mike from PSG
  • 5,312
  • 21
  • 39