Jun-21-2017, 09:12 PM
I wasn't sure whether to post this in "General Coding Help" or "GUI", as I'm encountering the problem in a tkinter-based GUI script, but I think the issue is my limited understanding of subprocess.run(), so I thought I'd post here.
What I've written is a script that creates, populates, and saves a spreadsheet, then launches libreoffice Calc and loads the saved file, using subprocess.run(). What I want is for the python script when executed to finish and exit, closing the GUI and leaving the spreadsheet running - in essence, I'd like the script to "launch the desired program and then quit." What's happening instead the spreadsheet launches and loads its data file just fine, but the python script continues running until you close the spreadsheet. I'm wondering whether I need some additional argument to subprocess.run() to fork off a new process in which to run the spreadsheet, or something of that sort.
I've posted only the code that launches the spreadsheet, loads the saved file, and exits, for the sake of brevity.
Any idea what I'm missing.
What I've written is a script that creates, populates, and saves a spreadsheet, then launches libreoffice Calc and loads the saved file, using subprocess.run(). What I want is for the python script when executed to finish and exit, closing the GUI and leaving the spreadsheet running - in essence, I'd like the script to "launch the desired program and then quit." What's happening instead the spreadsheet launches and loads its data file just fine, but the python script continues running until you close the spreadsheet. I'm wondering whether I need some additional argument to subprocess.run() to fork off a new process in which to run the spreadsheet, or something of that sort.
I've posted only the code that launches the spreadsheet, loads the saved file, and exits, for the sake of brevity.
Any idea what I'm missing.
root = Tk() # (code omitted for brevity) # The result have already been written into an .xlsx file, the name of which is stored in saveFileName run_argList = ["C:\\Program Files\\LibreOffice 5\\program\\scalc.exe",saveFileName] x = subprocess.run(run_argList) root.quit()