Please help to achieve output of shell in python
-
typo error in above python code line 5. It is hpeesofde.exe instead of xwgen.exeHarsh– Harsh2017-04-08 06:25:17 +00:00Commented Apr 8, 2017 at 6:25
-
1Please delete that image and paste your two console I/O blocks in as text. A formatting tool is provided in the toolbar.halfer– halfer2017-04-10 11:01:12 +00:00Commented Apr 10, 2017 at 11:01
Add a comment
|
1 Answer
You can hook up stdin and stdout of processes together in python using Popen but it's usually easiest to let shell shell do the work, for example you can:
subprocess.check_output('ls | grep something', shell=True)
Related: How do I use subprocess.Popen to connect multiple processes by pipes?
