title: Opening named pipe in one module, reading in the other
body: <p>I'm hot on the trail of figuring something out for one of my projects, but hung up on one issue:</p>
  
  <p>I'm using a FIFO operation to send a 'signal' (simple T/F) from one module to another. One module opens the FIFO to write to it, and the other opens the FIFO to read from it. The goal here is to have the reading module immediately read and display as soon as the writing module receives the command to do so. The writing module opens the FIFO, but the reading module doesn't seem to do so.</p>
  
  <p>Is what I'm trying to do even possible? I'm trying to spin both operations in _threads in order to keep multiple processes going in each module. Note both modules are in classes that I didn't include for the sake of brevity (explaining 'self').</p>
  
  <h1>original sending module</h1>
  
  <pre><code>def pipe_relay(self):
      FIFO = 'pipe_relay'
      thread_num = num
  
      try:
          os.mkfifo(FIFO)
      except OSError as oe:
          if oe.errno != errno.EEXIST:
              raise
  
      while self.relay_switch:
          print("Opening FIFO...")
          with open(FIFO) as fifo:
              print("FIFO opened")
              while self.relay_switch:
                  data = fifo.write(signal)
                  if len(data) == 0:
                      print("Writer is closed")
                      break
                  print('Write: "{0}"'.format(data))
  </code></pre>
  
  <h1>updated sending module</h1>
  
  <p>I realized that I didn't want to be writing to the FIFO continuously with the data I threw at it, so I removed the while() statement. Now, it doesn't seem as though the FIFO will open at all...</p>
  
  <hr>
  
  <pre><code>def pipe_relay(self, num, signal):
      FIFO = 'pipe_relay'
      thread_num = num
  
      try:
          os.mkfifo(FIFO)
      except OSError as oe:
          if oe.errno != errno.EEXIST:
              raise
  
      print("Opening FIFO...")
  
      # does not proceed past this point
  
      with open(FIFO, mode = 'w') as fifo:
          print("FIFO opened")
          data = fifo.write(signal)
          if len(data) == 0:
              print("Writer is closed")
          print('Write: "{0}"'.format(data))
          fifo.close()
  </code></pre>
  
  <h1>receiving module</h1>
  
  <pre><code>def pipe_receive(self):
      FIFO = 'pipe_relay'
  
      try:
          os.mkfifo(FIFO)
      except OSError as oe:
          if oe.errno != errno.EEXIST:
              raise   
  
      # module proceeds to here, but no further
  
      with open(FIFO) as fifo:
          print("FIFO opened (receiver)")
          while True:
              data = fifo.read()
              if len(data) == 0:
                  print("Writer is closed")
                  break
              print('Read signal: "{0}"'.format(data))
              self.DISPLAY['text'] = data
      print("this is in 'pipe_receieve'")
  </code></pre>
  
  <p>EDIT</p>
  
  <p>Running Ubuntu 17.04. The project is written for the Python 3.5 interpreter.</p>