subprocess.Popen mit < ..
Verfasst: Montag 16. Mai 2011, 13:16
Hi,
ich muß via Python ein command ausführen welches in der commandline so aussieht:
theTool -t < someFile param1 param2 param3
Ich hab leider keinen Plan wie ich das via Python mache..
So habe ich es probiert:
Das scheint aber nicht zu funktionieren.. also selbst das erste "someFile" kommt scheinbar schon nicht an wie es sollte..
Bin ich da auf dem richtigen weg? Oder funktioniert das komplett anders?
Danke,
Aya
ich muß via Python ein command ausführen welches in der commandline so aussieht:
theTool -t < someFile param1 param2 param3
Ich hab leider keinen Plan wie ich das via Python mache..
So habe ich es probiert:
Code: Alles auswählen
p = Popen(['theTool', '-t'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
p.communicate(input='someFile')
p.communicate(input='param1')
p.communicate(input='param2')
p.communicate(input='param3')Bin ich da auf dem richtigen weg? Oder funktioniert das komplett anders?
Danke,
Aya