title: Python class service
body: <p>I have a class called <code>Camera</code> which is initializing the webcam on Linux using Python, but I have a problem with that class. I want to use that class in multiple programs. I made the class a singleton. When I access the class multiple times in same program it works perfectly, it returns a single instance. But when I access the class from other program it create other instance. For example:</p>
  
  <pre><code>class Camera():
      __new__():
      .....
      .....
      print "__new__ called"
      __init__():
         get_frame();
         print "__instance created"
  
  c1 = Camera()
  c2 = Camera()
  Results:
  __new__ called
  __instance created
  __new__ called
  </code></pre>
  
  <p>But I want to access the class from multiple program like:</p>
  
  <pre><code>main1.py
  main2.py 
  main3.py
  </code></pre>
  
  <p>I want to access this class from multiple programs and I want the class to initialize just once and then return same instance to every program calling this class.</p>
  
  <p>Is there any way that I create a program or service of <code>Camera</code> class and I run the class individually and I will access the elements of class from other programs?</p>
  
  <p>Please give an example of how to run the class as an application or service and how to call the elements of that running class in other programs.</p>