I am creating a GUI application using eel library in python. index.html contains login form and if login is successful I want to open retrieve.html.
This is my python code and please consider login as successful.
@eel.expose
def retrieve():
eel.start('retrieve.html', size=(1000, 700))
eel.start('index.html', size=(1000, 700))
This is my javascript code
function login_func()
{
var username = document.getElementById("username").value
var pword = document.getElementById("pword").value
eel.login(username, pword)(set_result)
}
function set_result(result)
{
if(result == "Failed")
{
window.alert("Please insert correct username and password")
}
else
{
window.close()
eel.retrieve()
}
}
Everything works fine but I am getting an error message and that is
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted: ('localhost', 8000)
How can I avoid this?
Use different port No. for 2nd window, as mentioned below:
@eel.expose def retrieve():
eel.start('retrieve.html', size=(1000, 700), **port = 8080**)eel.start('index.html', size=(1000, 700), port = 8000)
or Alternatively, check this https://deecode.net/?p=438&lang=en