0

Written both shell and oython codes for understanding

Please help to achieve output of shell in python

halfer
  • 19,824
  • 17
  • 99
  • 186
Harsh
  • 35
  • 1
  • 5
  • typo error in above python code line 5. It is hpeesofde.exe instead of xwgen.exe – Harsh Apr 08 '17 at 06:25
  • 1
    Please delete that image and paste your two console I/O blocks in as text. A formatting tool is provided in the toolbar. – halfer Apr 10 '17 at 11:01

1 Answers1

1

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?

Community
  • 1
  • 1
Trevor Merrifield
  • 4,541
  • 2
  • 21
  • 24