title: Read data from specific memory address / reference to object
body: <p>How can I read (and put into new variable) data stored at specific memory address?</p>
  
  <p>For instance I know that:</p>
  
  <pre><code>  &lt;nfqueue.queue; proxy of &lt;Swig Object of type 'queue *' at 0xabd2b00&gt; &gt;
  </code></pre>
  
  <p>And I want to have data stored at 0xabd2b00 in new variable so that I can work and use all functionalities of the object. Let's assume that I don't have access to the original variable that created this object.</p>
  
  <p>UPDATE:
  Above question has been answered so I update my question.
  Let's assume I have two python files: file1.py and file2.py</p>
  
  <p>File1.py:</p>
  
  <pre><code>.... rest of the code ....
  class new_thread(threading.Thread):
  
      def __init__(self, obj):
         self.obj = obj
         threading.Thread.__init__(self)
  
      def run(self):
          str = 'python file2.py'
          args = shlex.split(str3)
          tmp = subprocess.Popen(args, stdout=open('/dev/null','w'), stderr=open('/dev/null', 'w'))
  .... rest of the code ....
  </code></pre>
  
  <p>At some point thread new_thread is called.</p>
  
  <p>File2.py:</p>
  
  <pre><code>kolejka = nfqueue.queue()
  </code></pre>
  
  <p>Here the queue is created, binded and opened. Then endless loop for listening is executed. The only way to end it is to unbind and close kolejka, but I want file1.py to do that as it is a "master" programme. How can I retrieve initialized kolejka from file to close queue properly after new_thread is done?</p>
  
  <p>When I try:</p>
  
  <pre><code>from file2 import kolejka
  </code></pre>
  
  <p>The script executes all procedure of creating queue from the beginning (it hasn't been written as a function).</p>