Q:

Have a class have access to a parameter from another class

I have two classes, classA and classB. classA has an attribute named image that contains data that is changing all the time. I want to be able to have an instance of classB that when I call a method on this instance, it can access self.image from classA. Unfortunately my attempts are failing.
Example code:
classA:
    def __init__(self):
        self.image = None #initialise
        analysis = classB(self)

    def doingstuff(self):
        self.image = somethingchanginghere()
        measurement = analysis.find_something_cool()
        print measurement

classB:
   def __init__(self, master):
       self.image = master.image #get a reference to the data from other class

   def do_something_cool(self):
       return type(self.image) #find something about the data at the point when method is called

main = classA()
main.doingstuff()

I get an error that says the data is still None, i.e. it's still in the state when it was initialised and the reference to classA from classB hasn't updated when self.image in classA changed. What have I done wrong?
Why does the working example give NoneType? I'm expecting a random number.

A:

There are two problems with your code:

analysis is a variable local to the classA.__init__ and classA.doingstuff functions. If you wish to re-use it in other functions, you should define it as an attribute: self.analysis = classB(self).
Python doesn't pass variables by reference. When you do analysis = classB(self), you create an object of classB, passing the object self as an argument. It is not a reference to the object, so classB.image is set and/or changed only once, in classB.__init__. If you wish to keep it updated, you should either do:
classB:
    def __init__(self, master):
        self.master = master

and then use master.image to get the image, or implement a classB method e.g. 
def update(self, image): 
    self.image = image

and call it every time image changes.

