Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
silly piping
#1
i've been researching (reading docs, googling) about piping output from child processes. it seems everything is oriented around the way the communicate() function works, which is to collect all the output from the child process and return it to the caller after the output is finished (EOF).  is this how most programmers work?
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
It depends on what you need. If waiting for it to finish is what you want, then that works great. If you want to work with data while another process generates it, so both run at the same time, then using a pipe (a named pipe, not communicate()) is the way to do that. Unless you care about scaling, in which case the two processes might be on different machines, in which case communication is done over sockets, databases, or named pipes.

Fun fact: you can create named pipes on a samba share. Samba is also one of the things you can use Microsoft Azure for, for free. Although a lot of internet providers block the smb protocol.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  When piping a FFMPEG stream to PyAudio, I get a "click" on every loop klehman 0 4,850 Dec-15-2019, 04:22 AM
Last Post: klehman
  example of multiprocess piping Skaperen 4 6,048 Dec-02-2016, 12:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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