Closed wimpykid719 closed 3 years ago
Hi, @wimpykid719
from python
def get_progress(self, threads):
while any(t.is_alive() for t in threads):
with self.lock:
percent = round(sum(self.percent.values()) / (self.count * 2))
# sys.stdout.write(' {percent}%\r'.format(percent=percent))
eel.putProgress(percent)
print(f' {percent}%', flush=True)
JS
const p = new ProgressBar();
const putProgress = p.putProgress()
eel.expose(putProgress)
to
Python
@eel.expose
def get_progress(self, threads):
while any(t.is_alive() for t in threads):
with self.lock:
percent = round(sum(self.percent.values()) / (self.count * 2))
# sys.stdout.write(' {percent}%\r'.format(percent=percent))
eel.putProgress(percent)
print(f' {percent}%', flush=True)
JS
const p = new ProgressBar();
const putProgress = p.putProgress()
window.eel.expose(putProgress, "putProgress")
let me know It works or not
Hi Sorry for late rep I think It doesn't matter I already solve this problem 4 month ago. And I forget how did I do. but I update my github repository so We can see what is changed.
Thank you for good library.
Now I'm making desktop app with your library.
The app has function to show file writing progress.
Python
This function get a progress number like a 43. and I'm trying to send this number to frontend using
eel.putProgress(percent)
. It can start app but it shows error. Could you help me please how do I write a code and call JS from PythonJS
error
Here is every code push to github
Desktop (please complete the following information):