'PySimpleGuiWeb change ip address
I have a python script that uses PySimpleGuiWeb. I want to host it on my server and connect to it from another computer. But the script is running on 127.0.0.1. Can I somehow change this, or is there another way?
Solution 1:[1]
From the host device running the pysimplegui python script, you can likely load the gui via 127.0.0.1:###### through a browser (where ##### is your port). This is because it's hosted and being accessed from the same device.
Accessing from another device on the same network: try using the IP of the device hosting the pysimplegui followed by the same port as is used locally by host device to access gui.
e.g. 172.20.10.5:######
IP of the host device found via: Linux(terminal): ifconfig Mac(terminal): ifconfig Windows(command prompt): ipconfig
You can make the IP of your gui host device static and according the pysimplegui you can make the port static too, therefore the GUI should be always found at the same IP:port externally (given the static IP holds and doesn't get reallocated and that port isn't blocked for any reason by network etc.)
Update: In addition, with some further reading, optional arguments to a 'Window' include: web_ip='0.0.0.0', web_port=0 https://github.com/PySimpleGUI/PySimpleGUI/blob/master/PySimpleGUIWeb/PySimpleGUIWeb.py
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
