title: Python Curses: Controlling Two Terminals with One Script (Linux)
body: <p>I would like to make a single Python script to control curses in two seperate terminal windows.  Not curses windows within a single terminal, but two different instances of, say, urxvt in my X window manager. </p>
  
  <p>Something like this:</p>
  
  <pre><code>class myprogam():
  
      controlterm1()
      controlterm2()
  
      def controlterm1():
          Create a new (could be current) urxvt terminal window.
          In the urxvt window setup curses with curses.initscr(), etc.
          racergame()
  
      def controlterm2():
          Create another urxvt terminal window.
          Setup curses.initscr, borders, size, etc. in window, leaving the old one alone.
          typewriter()  
  
      def racecargame():
          Racing game in curses
  
      def typwritter()
          Boring program for writing
  
  myprogram()
  </code></pre>
  
  <p>I see that pseudo-terminal windows are given a name when I use the command "tty", and this gives me a reference to /dev/pts/somenumber, where the first terminal emulator is assigned a zero, then 1, 2, etc for new terminals.  Can I use this identifier as a basis to do this?</p>
  
  <p>The script does NOT have to actually load a new instance of urxvt, as I am happy if it can just control one that is already open.</p>