You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python...@googlegroups.com
Hi,
I'd like to have something like `get_both`, except instead of getting the stdout and stderr in separate strings, I'd like to get one string which has both of them, in the order that they were typed. Possible?
Thanks,
Ram.
Vinay Sajip
unread,
Jan 18, 2014, 10:27:29 AM1/18/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python...@googlegroups.com
On Friday, January 17, 2014 9:41:38 PM UTC, Ram Rachum wrote:
I'd like to have something like `get_both`, except instead of getting the stdout and stderr in separate strings, I'd like to get one string which has both of them, in the order that they were typed. Possible?
Yes, you just pass the same Capture instance as both stdout and stderr, e.g.
from sarge import Capture, run
c = Capture()
run(cmd, stdout=c, stderr=c)
Then c.text would have the text of both the child process stdout and stderr, mixed together (but the order is not always what you might expect).