title: How to make two Python programs communicate?
body: <p>I have two Python programs, one is a IRC bot, using sockets to connect to an IRC server.</p>
  
  <p>This program has a loop that reads every PRIVMSG from an specific channel.</p>
  
  <p>The second program should get whatever the first program outputs (the PRIVMSG in this case) and runs functions with it.</p>
  
  <p>So, it's basically:</p>
  
  <pre><code>while 1:
      data = irc.recv(2048)
      if data.find("PRIVMSG " + current_channel + " :") != -1:
          send_to_second_program(data)
  </code></pre>
  
  <p>the second program is</p>
  
  <pre><code>while 1:
      data = get_from_first_program()
      do_stuff(data)
  </code></pre>
  
  <p>Is there a way to make this happen without using modules? The two programs should be separate.</p>