error when using block=False on eel.start()
See original GitHub issueI was trying to use block=False on eel.start() and mode=None to start the server without any GUI anbd then, with cefpython, open a new GUI. When i tried this, CEFpython appeared with a white screen, and then I tried mode=“chrome”, and chrome displayed error saying that localhost:4567 was not accesible, but if I set block=True it was working perfectly.
Python3 64bit Windows 10 Pro 64bit Cefpython v66 chrome 83
Code:
import eel
eel.init('web')
eel.start(mode=chrome, port=4567, block=True) #Working Fine
eel.start(mode=chrome, port=4567, block=False) #Page not found Error like this:
<html>
<!-- some html text-->
</html>
Thanks 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Blocking False is not working · Issue #477 · python-eel/Eel
Eel version 0.14.0 Describe the bug When I use the eel.start("index.html", blocking=False) statement then the browser opens with the ...
Read more >Python: running eel with multithreading results in a error
Solution. Your code is starting two threads and immediately exits main thread, which causes the rest of the threads to ...
Read more >Top 5 Eel Code Examples - Snyk
To help you get started, we've selected a few Eel examples, based on popular ways it is used in public projects. Secure your...
Read more >Eel - PyPI
Eel is a little Python library for making simple Electron-like offline HTML/JS GUI apps, with full access to Python capabilities and libraries.
Read more >Python GUI Using Chrome - Nitratine
start(). If you want to execute code underneath eel.start() you can pass block=False as an argument to stop it from blocking. For ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, Finally I managed to make it work. I used Process from multiprocessing instead of eel.spawn, because I needed two REAL different processes, not an emulation, because eel.spawn() uses a thread. Now it works, and the full code is that one:
The thing is that now i can have the cef.MessageLoop() and eel.start() with its while True: working at the same time.
(If you try to run this, do NOT try it on IDLE, because it won’t work on idle, it needs to be executed as a .py file.)
Lots of thanks for the help 😄. I’ll close this, because the problem is now solved.
Not working… I’m trying this:
So, It starts running nice for the 5 first seconds (ot for the x seconds that are set on line 7) and then, while cefpython is running, the main loop stops printing “I’m a main loop” and if I reload the chrome window, it gives me the error. Then, when I close the cefpython window, the program starts printing “I’m a thread” as normal, because the cef_thread() function ends with a final loop, and the “I’m a main loop” loop recovers activity, and, if I reolad chrome window, it reloads perfectly the localhost:4567 page. So I think the solution may be to run the cef_thread() on another process, instead of running it with eel.spawn(). Because the server and cef are running on the same process, and cef has a cef.MessageLoop that stills running until cef is colsed. I’ll try it out and post the results…