Python Forum
Run an app in a standalone terminal and wait until it's closed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run an app in a standalone terminal and wait until it's closed
#1
I would like to run an app in a separated terminal from my Python3 script and make the script wait until I close the terminal. I tried to run this code:
result = subprocess.run(["xfce4-terminal", "-e", "./etherdump.sh"], capture_output=True)
but it goes further w/o waiting of closing the xfce4-terminal. How can I make it wait the app closed?
Reply
#2
What happens if you run xfce4-terminal from the command line?

subprocess.run() DOES wait for the command to finish. So my guess is that the terminal starts up a new process, then immediately exits. Is there a reason you can't just run the "etherdump.sh" script directly?
Reply
#3
(Aug-29-2020, 09:24 PM)nilamo Wrote: What happens if you run xfce4-terminal from the command line?

subprocess.run() DOES wait for the command to finish. So my guess is that the terminal starts up a new process, then immediately exits. Is there a reason you can't just run the "etherdump.sh" script directly?

I had to run the "etherdump.sh" from my python-ะตะป app by button click, then wait and close the script after some time of its work at the moment I could recognize only visually. After finishing the script I had to go further with its results in the python app. That's why I needed to implement such run in a standalone terminal window. Ultimately I resolved the issue with replacement of "xfce4-terminal" for "xterm".
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  This result object does not return rows. It has been closed automatically dawid294 6 1,005 Mar-30-2024, 03:08 AM
Last Post: NolaCuriel
Question [SOLVED] Tiny web server as standalone executable? Winfried 0 324 Feb-09-2024, 11:48 AM
Last Post: Winfried
  Wait til a date and time KatManDEW 2 1,413 Mar-11-2022, 08:05 PM
Last Post: KatManDEW
  wait for the first of these events Skaperen 4 1,933 Mar-07-2022, 08:46 PM
Last Post: Gribouillis
  how to do a two-way wait Skaperen 2 1,258 Mar-04-2022, 02:31 AM
Last Post: Skaperen
  A question about 'Event loop is closed' fc5igm 2 2,201 Oct-05-2021, 02:00 AM
Last Post: fc5igm
  ValueError: I/O operation on closed file problem aliwien 0 2,107 Apr-23-2021, 05:50 PM
Last Post: aliwien
Lightbulb Standalone application samuelbachorik 8 3,512 Aug-02-2020, 01:57 PM
Last Post: samuelbachorik
  python os.popen is not working for wait method elenaflorence87 0 1,998 Jul-22-2020, 12:56 PM
Last Post: elenaflorence87
  Wait for command within a process bRitch022 1 3,237 Jul-15-2020, 07:03 PM
Last Post: bRitch022

Forum Jump:

User Panel Messages

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