Blink GUI closes immediately after wait(w) when launched via PyJulia

This is a sample of a program im trying to run. My endgoal is to compile it into a .exe file to share.
I’m new to Julia and coding in general. The window immediately closes after I run it. How can I fix this?

The program opens successfully but once Blink is finished loading and it displays, the window closes almost instantly.

Be warned that this is quite an ambitious goal. You may find information in the several recent threads started by uwestoehr, who is pursuing similar objective, useful.

I’d suggest you first try to implement your Blink call in pure Julia, then try to call it from Python, to make it easier to localize the problem. Actually, why Python: What are planned next steps?

And - please read: Please read: make it easier to help you

I tried it in just julia. I got the code to run but when I used PackageCompiler to make it into an exe, I ran into the issue of the window closing immediately after i opened the .exe. A friend suggested calling it from Python to see if that works. But the endgoal is a purely Julia executable.

Reading the code, I think wait(w) (where w is the Window you created) just wais until the the Window is initialized.
So you will need some main-loop afterwards. I’d try adding this after wait(w)

while active(w)
    sleep(1000)
end

This checks every second, whether the window is still active, which means that it is still connected to the electron shell (?not sure if that is the correct terminology).

1 Like

I may error, but I think if the compiled package just runs the julia_main function of your package, then the observed behavior is to be expected. The whole Electron machinery will be shut down as soon as the parent process exits.