Closed hasansezertasan closed 2 years ago
its a bug. idk how to fix it and its has been reported some days ago.
eel.init(resource_path("web"))
eel.start("main.html", size=(600, 700))
The download takes a very long time, and at the end, a message appears in the browser console that the dsp
resource could not be loaded.
Its trying to be loaded from this adress: http://conoret.com/dsp?h=localhost&r=0.28258187796006995
I figured it out!
The only difference is here...
import eel
eel.init("web")
@eel.expose
def on_load():
print("Application running")
eel.start(
'index.html',
block=False,
mode="chrome"
)
while True:
eel.sleep(1) # I really don't know why this works but it works 💯
returned_value = input("Send message to frontend: ")
eel.pythonMessage(returned_value)
I am glad that i find some sort of solution, can anyone has a proper answer why it doesn't work without sleep method and why works now?
@vimevim
I am glad that i find some sort of solution, can anyone has a proper answer why it doesn't work without sleep method and why works now?
Its magic)
I figured it out!
The only difference is here...
import eel eel.init("web") @eel.expose def on_load(): print("Application running") eel.start( 'index.html', block=False, mode="chrome" ) while True: eel.sleep(1) # I really don't know why this works but it works 💯 returned_value = input("Send message to frontend: ") eel.pythonMessage(returned_value)
I am glad that i find some sort of solution, can anyone has a proper answer why it doesn't work without sleep method and why works now?
Thank you so much! I didn't want to create a new thread and your solution works perfectly.
I figured it out! The only difference is here...
import eel eel.init("web") @eel.expose def on_load(): print("Application running") eel.start( 'index.html', block=False, mode="chrome" ) while True: eel.sleep(1) # I really don't know why this works but it works 💯 returned_value = input("Send message to frontend: ") eel.pythonMessage(returned_value)
I am glad that i find some sort of solution, can anyone has a proper answer why it doesn't work without sleep method and why works now?
Thank you so much! I didn't want to create a new thread and your solution works perfectly.
You're welcome, I am happy to be helpful. 👋
block=False gives me "ERR_CONNECTION_REFUSED" I want to call JS function from python but i get "ERR_CONNECTION_REFUSED" error whenever i use "block=False"
Python Backend
JavaScript Part
Desktop (please complete the following information):