Python Forum
a script i might need to write
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a script i might need to write
#1
a script i might need to write is to run another command is to capture both the stdout and stderr streams from that command, separately, with the order and interleaving preserved. so if that command writes to stderr first then to stdout, my script will see exactly what that command did. a test script would just copy the input to the output, so the command's stderr output goes to stderr, and the command's stdout goes to stdout.

does this sound too complicated?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Logging module? It's perfect to get both stdout and stderr.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
logging module to do the parallel reading from two pipes or just as sample code?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
For capturing both - stdout and stderr. It gives you more control and additional information what is going on.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020