<div>Take a look at the strategy pattern. But with python being a dinamic language, you probably won't need to implement it like that.</div>
<div> </div>
<div><a href="http://en.wikipedia.org/wiki/Strategy_pattern">http://en.wikipedia.org/wiki/Strategy_pattern</a></div>
<div> </div>
<div>Example:</div>
<div> </div>
<div># import all you need<br>CAMERAS = ['A','B','C']</div>
<div>def capture_A:<br> pass<br> <br>def capture_B:<br> pass<br> <br>def capture_C:<br> pass</div>
<div>def capture(camera):<br> if camera in CAMERAS:<br>  if camera = 'A':<br>   function = capture_A<br>   <br>  if camera = 'B':<br>   function = capture_B<br>   <br>  if camera = 'C':<br>   function = capture_C<br>

   <br>  # call function<br>  function()<br> else<br>  return</div>
<div><br> </div>
<div class="gmail_quote">On Fri, Feb 4, 2011 at 2:39 PM, Wanderer <span dir="ltr"><<a href="mailto:wanderer@dialup4less.com">wanderer@dialup4less.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">I have a bunch of cameras I want to run tests on. They each have<br>different drivers and interfaces. What I want to do is create python<br>

wrappers so that they all have a common interface and can be called by<br>the same python test bench program. I'm not sure what to call it. I<br>don't think it's inheritance. Maybe there is no official thing here<br>

and I just need to brute force my way through it. Is there some<br>programming methodology I should be using?<br><br>Thanks<br><font color="#888888">--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>

</font></blockquote></div><br><br clear="all"><br>-- <br>George R. C. Silva<br><br>Desenvolvimento em GIS<br><a href="http://blog.geoprocessamento.net">http://blog.geoprocessamento.net</a><br>