Hallo mit bash funktioniert das folgende kommando: feh -D 3 home... & ./main.py mit Python: from subprocess import call call(["feh", "-D", "3", "/home/...", "&", "./main.py"]) funktioniert es nicht, d.h es wird nur FEH gestartet...und Fehlermeldung kommt das & nicht möglich ist. Wie geht das mit Python richtig? Danke
https://docs.python.org/2/library/subprocess.html
1 | subprocess.call("feh -D 3 /home/... & ./main.py", shell=True) |
https://docs.python.org/3/library/subprocess.html
1 | subprocess.run("feh -D 3 /home/... & ./main.py", shell=True) |
epikao schrieb: > mit Python: > from subprocess import call > call(["feh", "-D", "3", "/home/...", "&", "./main.py"]) > > funktioniert es nicht, Kein Wunder. Damit rufst du das Programm auf und übergibst alles, was du dahinter schreibst (auch das & und das ./main.py) als Kommandozeilenparameter an feh. Es wird keine Shell gestartet, die das & interpretiert.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.