You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would I go about adding a startup function (a Python script to be exact) that runs when the app is launched? I've added a function to main.ts in src to do this (below), but it hasn't responded and just runs the createWindow() function. The only time it worked was when I added the python3 [path to script] to npm start but this doesn't worked when the app is packaged. I have not edited anything further than main.ts besides the npm start script in package.json above (which was removed)
Any help would be appreciated as the Python script is a tkinter module that populates a necessary json file. Additionally, this has to be a cross-platform application, so I can't use Pyinstaller to create .exe files.
Thanks!
app.whenReady().then(()=>{runPythonScript();// does this via the execSync() method from 'child-process'createWindow();app.on('activate',()=>{if(mainWindow===null)createWindow();});}).catch(console.log);
My python script at the moment for testing is just this:
How would I go about adding a startup function (a Python script to be exact) that runs when the app is launched? I've added a function to
main.ts
insrc
to do this (below), but it hasn't responded and just runs thecreateWindow()
function. The only time it worked was when I added thepython3 [path to script]
tonpm start
but this doesn't worked when the app is packaged. I have not edited anything further thanmain.ts
besides thenpm start
script inpackage.json
above (which was removed)Any help would be appreciated as the Python script is a tkinter module that populates a necessary json file. Additionally, this has to be a cross-platform application, so I can't use Pyinstaller to create .exe files.
Thanks!
My python script at the moment for testing is just this:
The text was updated successfully, but these errors were encountered: