This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to start tail in konsole with subprocess

Tags: None
(comma "," separated)
dragomird
Registered Member
Posts
2
Karma
0
I am using tail to output the listing from a solver using:

Code: Select all
outputListing = exportFileName.split(".pc")[0] + ".out"
solver_run = subprocess.Popen([solver_path, "-visual", "-solvargs", "-nt 4 -fp 2", exportFilePath, outputListing])
if os.sep == "\\":
    subprocess.Popen(["wintail",outputListing], shell = True)
elif os.sep == "/":
    if os.environ.get("DESKTOP_SESSION") == 'gnome'
        subprocess.Popen(["gnome-terminal", "-e","tail -f " + outputListing])
    elif os.environ.get("DESKTOP_SESSION") == 'kde'
        subprocess.Popen(["konsole", "-e","tail -f " + outputListing])


with this call the solver listing is output in GNOME with tail -f properly , but in KDE only the terminal (konsole) is started and no tail is executed. So probably I have to replace "-e" and "tail -f" accordingly. Any ideas for the right call? Thank you
dragomird
Registered Member
Posts
2
Karma
0
I found the solution by myself
subprocess.Popen(["konsole", "-e","$SHELL", "-c","tail -f " + outputListing])


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]