2

Written both shell and oython codes for understanding

Please help to achieve output of shell in python

2
  • typo error in above python code line 5. It is hpeesofde.exe instead of xwgen.exe Commented Apr 8, 2017 at 6: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. Commented Apr 10, 2017 at 11:01

1 Answer 1

2

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.