Closed nricciardi closed 3 years ago
You must use global
# python file main.py
import eel
# set title for index.html based settings(.json)
@eel.expose
def change_title():
try:
global settings
return settings["name"]
print("OK - change title: " + str(settings["name"]))
except Exception as e:
print("ERROR - change title: " + str(e))
'NoneType' object is not subscriptable NoneType error when i use expose function from javascript in python.
Code snippet(s) In settings["name"] there is a string returned from json file "settings.json" in root folder