Describe the problem
I am trying to call a JavaScript function but only when a if condition evaluates to True in Python. I'm working on a Music player project with Pygame and Eel, I want to call the JS function to change Song cover image automatically without a button click as the previous song ends, which am finding using pygame.mixer.music.get_busy() in python, during when I want to call the 'eel.fine()' but I'm sure why it's not working or how to get this done as am new to Eel
Expected When if condition becomes True function find should be called from python code i.e just want to change cover image when one song ends
Code snippet(s)
Here is some code that can be easily used to reproduce the problem or understand what I need help with. Note: I have removed most part of the code just to make to understand and have only added the portions that relate to the flow of the code what I need help with.
import eel
from pygame import mixer
eel.init('web')
js='function $fine(){document.getElementById("spl").live("click");}'
def my_update():
if pausev and not fine:
if not start and not mixer.music.get_busy():
#ok=js2py.eval_js(js)
# ok()
print("booom")
eel.fine() # This is the part I need help with
play()
print('new song up')
else:
print('old playing still')
else:
print('strictly paused')
Describe the problem I am trying to call a JavaScript function but only when a if condition evaluates to True in Python. I'm working on a Music player project with Pygame and Eel, I want to call the JS function to change Song cover image automatically without a button click as the previous song ends, which am finding using pygame.mixer.music.get_busy() in python, during when I want to call the 'eel.fine()' but I'm sure why it's not working or how to get this done as am new to Eel
Expected When if condition becomes True function find should be called from python code i.e just want to change cover image when one song ends Code snippet(s) Here is some code that can be easily used to reproduce the problem or understand what I need help with. Note: I have removed most part of the code just to make to understand and have only added the portions that relate to the flow of the code what I need help with.
UPDATE It partially works and does not work as expected
Error that I get during running normally
Whereas the Output when I open inspect - console![image](https://user-images.githubusercontent.com/56349099/139001211-33575a5d-f423-4897-b7ca-8a9e1972eefc.png)
Desktop (please complete the following information):