Python Error: AttributeError: IR instance has no attribute 'xySinglePos'
<p>These are my files:</p>

<pre><code>#IRClass.py
from VideoCapture import Device
import Image
from ctypes import *
class IR:
    def __init__(self):
        self.cam = Device()
        self.user = windll.user32 #Handle for the mouse
        rp = self.cam.getImage()
        self.res = (rp.size[0],rp.size[1])
    def irSingle(self,im):
        imxy = im.getprojection()
        imx = imxy[0] #x coordinates
        imy = imxy[1] #y coordinates
        x = imx.index(1) #try to find a 1
        y = imy.index(1) #which is really our IR dot
        return (x,y)
    def xySinglePos(self, scale=(1440,900)):
        try:
           im = self.cam.getImage()
           im.resize(scale)
           x,y = IR.irSingle(self,im)
           return (x,y)
        except ValueError:
           pass
    def setPos(self,x,y):
        self.user.SetCursorPos(x,y)


#IRtest.py
import IRClass

ir = IRClass.IR()
while 1:
    x,y = ir.xySinglePos(scale=(1440,900))
    ir.user.SetCursorPos(x,y)
</code></pre>

<p><a href="http://kbcarte.wordpress.com/2010/07/21/hello-world/#comment-75" rel="nofollow">http://kbcarte.wordpress.com/2010/07/21/hello-world/#comment-75</a></p>
