-1

The following questions regard how to write subprocess.call to output files.

Question1

Question2

Is there away to redirect standard output of subprocess.call() to a string object in python, instead of having to create a file? For example, I would like to call the md5sum command, and simply save the results as a string. Is there a way to forgo the file making step?

1
  • 1
    Why down votes? Seems to me that research was performed, and the question is clear and useful. Feedback is appreciated. Commented Mar 25, 2015 at 21:58

1 Answer 1

2

Sure, use subprocess.check_output() in a similar fashion (it has the same argument structure as call) and it will return the output as a byte string for you.

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.