DEV Community

Cover image for How i add global script eel.js in svelte-sapper proyect and use eel.expose?
tlaxcalajuan
tlaxcalajuan

Posted on

How i add global script eel.js in svelte-sapper proyect and use eel.expose?

I need create a desktop app with eel-python and svelte as frontend, I am use sapper.

Top comments (4)

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀 • Edited

Show some steps that you have done perhaps we can spot a problem ...

Collapse
 
tlaxcalajuan profile image
tlaxcalajuan

import eel
eel.init('sapper/export')
eel.start('index.html',port=8080)

@eel.expose
def say_hello_py(x):
print(x)

print('Calling Javascript...')
eel.my_javascript_function(1, 2, 3, 4)

eel.say_hello_js('vrce')

Collapse
 
tlaxcalajuan profile image
tlaxcalajuan
Collapse
 
tlaxcalajuan profile image
tlaxcalajuan