title: Python adding a value to buffer
body: <p>I am having an issue with using multiple values from different pieces of code.
  I have 4 python files which need to communicate back and forth different values.</p>
  
  <p>I have a <code>rotary_encoder</code>, a <code>webserver</code>, a <code>X11(gtk)</code> and <code>rotary_Handler</code>.</p>
  
  <p><code>rotary_Handler</code> checks a physical rotary encoder and creates events then passes that to <code>rotary_encoder</code>, Then <code>rotary_encoder</code> sets Output and Pressed variables.</p>
  
  <p>Webserver sets a len(outfiles) variable and gets the Output and Pressed variables.</p>
  
  <p><code>rotary encode</code>r also gets to <code>len(outfiles)</code> variable and uses it to reset the output variable <code>(if output &gt; lef(outfiles): outfiles = 0)</code>.</p>
  
  <p><code>x11(gtk)</code> gets the Pressed variable.</p>
  
  <p>The <code>X11</code> and <code>webserver</code> must remain separate and both require variables from the <code>rotary_encoder</code> file and all are endless code (will run until manually stopped).</p>
  
  <p>I was thinking about putting the 3 variables into a memory buffer and then grab the buffer into the files I need. I have never used buffers or anything before so if anyone could get me started or provide different methods of importing these variables i would appreciate it. </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><code>rotary_encoder</code> uses RPi.GPIO module and collects I/O data from the GPIO pins</p>
  
  <p><code>rotary_Handler</code> uses RPi.GPIO and gets events from <code>rotary_encoder</code>.</p>
  
  <p><code>webserver</code> is a python-Flask webserver creating 2 pages ('index' and '/receiving') uses pyserial to transmit data across the GPIO RX/TX pins. Also gets a list of files using Glob.</p>
  
  <p><code>x11(gtk)</code> is x11 wrapper for a python script (using xinit), python script is Python-GTK and webkit to create a simple webbrowser.</p>
  
  <p>When I turn the rotary encoder I am selecting a value from the Glob list (a html file) and setting the index of the server to a new webpage. When a new webpage is set i need to restart the flask webserver, refresh the python-GTK webbrowser and keep the rotary encoder running without changing its value.</p>
  
  <p>Also the Glob list has a max value, I need to tell the rotary encoder that when it hits that max value to default back to 0 and continue. The Glob list can have 1 or 1 million files depending on the task.</p>