Launch gnome-terminal with args and wait close

Asked by Michael A. Phillips

I have a cli-based application that outputs HUGE amounts of logs when running. Currently I use:

import subprocess, sys, os, os.path, shutil
MAPNinox=("/Astronomy/5-Permanent/Software/ninox/ninox -display -cut=150 -qestimator -qrenumber -resample=2/1 -outdir=/Astronomy/Sorted/2-Scratch/" + DATE.rstrip('\r\n') + "/" + TIME.rstrip('\r\n') + " /Astronomy/Transit/1-Corianders/" + DATE.rstrip('\r\n') + "/" + TIME.rstrip('\r\n'))

This write LOTS of message logs and slows down the app TOO much. I can't figure how to shut logs.

I would like to use:

MAPNinox=("gnome-terminal --title=NINOX --geometry=50x12 -x /Astronomy/5-Permanent/Software/ninox/ninox -display -cut=150 -qestimator -qrenumber -resample=2/1 -outdir=/Astronomy/Sorted/2-Scratch/" + DATE.rstrip('\r\n') + "/" + TIME.rstrip('\r\n') + " /Astronomy/Transit/1-Corianders/" + DATE.rstrip('\r\n') + "/" + TIME.rstrip('\r\n'))

When I use that, the app is now gnome-terminal with args passed to the term to make it 'autorun'

This is much faster, but sikuli steps right passed the gnome-terminal and I need it to wait until it's done.

TIA,

Mike

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Michael A. Phillips
Solved:
Last query:
Last reply:
Revision history for this message
Michael A. Phillips (maphilli14) said :
#1

As a temp workaround I ran from CLI with -s option.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

MAPNinox in both cases contains the command you want to issue.

But how do you issue the command from the Sikuli script?

What about using subprocess? There are many options.

The easiest way:
- before issuing the command create a null-content-file somewhere
- pack your app call in a shell script, that deletes this file after your app has terminated
- after issuing the command to launch the shell script from the script, look every second or so, wether the file still exists
- continue your Sikuli script after the file is deleted