Python Forum
printing interleaved lines from many processes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
printing interleaved lines from many processes
#1
a new program (no code, yet) will launch many child processes that all will be printing long lines of info to stdout that is passed along from the parent (not piped to the parent). it is essential that each line stay whole and that the interleaving between lines never breaks a line in the middle no matter how stdout gets redirected by the shell when program gets run. lines will not be longer than 1000 characters but they could have Unicode characters in UTF-8 form some day in the future. this will only ever be run on Linux, BSD, Mac, or Unix, never on Windows, DOS, or OS/2. what is the best way, in Python, to ensure that this works?

edit:

to be clear, the parent is passing along stdout that it originally got when it began.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
printing interleaved lines from many processes - by Skaperen - May-21-2019, 12:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  launch processes from threads Skaperen 9 1,012 Feb-21-2024, 01:16 AM
Last Post: Skaperen
  order to call Popen for 2 piped processes Skaperen 0 1,207 Oct-22-2020, 11:31 PM
Last Post: Skaperen
  capture stdout from child processes Skaperen 0 3,366 Oct-30-2019, 12:11 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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