+1 vote
by
Hello! The python function return doesn't work. The java script console.log() prints null.

JavaScript code:
var tut = eel.istatus();
console.log(tut)
if (tut == "show"){
$('.main').toggle();
};
Python code:
@eel.expose
def istatus():
with open("tstatus.ini") as file:
tstatus = file.read()
if tstatus == "1":
itut = "show"
return itut
by
Apparently, the condition does not pass.tstatus == "1" Apparently, the condition does not pass.
by
buymyopps It is possible that there are non-printed characters like \n, so the comparison does not work.
by
Alexei Ukolov , it passes, there is only one unit in the file, if you write print(tstatus) it also shows one and the data type also matches
by
Pashenka , communicates everything with the eel library in python

1 Answer

0 votes
by
tstatus is not equal to "1"
...