Python Forum
Program-launching script will not close until the program it launches is closed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program-launching script will not close until the program it launches is closed
#1
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.

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()
Reply


Messages In This Thread
Program-launching script will not close until the program it launches is closed - by mmwatson - Jun-21-2017, 09:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  This result object does not return rows. It has been closed automatically dawid294 6 1,079 Mar-30-2024, 03:08 AM
Last Post: NolaCuriel
  kill python execution program lebossejames 0 248 Mar-16-2024, 11:16 AM
Last Post: lebossejames
  Unexpected termination of program when using JDBC drivers in python with jaydebeapi skarface19 2 338 Feb-17-2024, 12:01 PM
Last Post: skarface19
  Basic Coding Question: Exit Program Command? RockBlok 3 579 Nov-19-2023, 06:31 PM
Last Post: deanhystad
  how come i can't stop program Shi_Shi_Shi_Shi 4 615 Nov-16-2023, 06:20 PM
Last Post: deanhystad
  Using Autostart to run a GUI program at startup. Rpi Edward_ 1 629 Oct-28-2023, 03:19 PM
Last Post: SpongeB0B
  Program to find Mode of a list PythonBoy 6 1,109 Sep-12-2023, 09:31 AM
Last Post: PythonBoy
Question Using SQLAlchemy, prevent SQLite3 table update by multiple program instances Calab 3 758 Aug-09-2023, 05:51 PM
Last Post: Calab
  program needs this plugins robertkwild 1 474 Aug-09-2023, 04:33 PM
Last Post: deanhystad
  Help with flowchart maker program bluebouncyball 2 767 Aug-08-2023, 10:25 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020