Oct-04-2019, 03:49 PM
Thanks everyone for your comments....Please bear with me as I am new to this....I am experimenting with some of the comments above, in particular
I can see t by using sandbox.test.t (please jump in and correct me if I go awry)...By not using the parentheses after test (ie sandbox.test() implies I have NOT created an instance, is this correct?)
Now to see k I must do something like j = sandbox.test(); j.k....Is this correct? (seems to work)
I ALSO notice here that j.t works too...guessing that is because the instance is a subset of the class so all is good
How do I access m? Does it have to live outside the instance creation (__init__)? Seems it could live anywhere assuming you don't put self tag on it....
Last question: can I declare 'self' attributes in methods other than __init__ ? and are they accessible by external and internal?
thanks again for all the help out there! Everyone is very responsive....this is a great forum
class test: t = visa.ResourceManager() def __init__(self): self.k = visa.ResourceManager() m = visa.ResourceManager()I have a file sandbox.py....I import sandbox....
I can see t by using sandbox.test.t (please jump in and correct me if I go awry)...By not using the parentheses after test (ie sandbox.test() implies I have NOT created an instance, is this correct?)
Now to see k I must do something like j = sandbox.test(); j.k....Is this correct? (seems to work)
I ALSO notice here that j.t works too...guessing that is because the instance is a subset of the class so all is good
How do I access m? Does it have to live outside the instance creation (__init__)? Seems it could live anywhere assuming you don't put self tag on it....
Last question: can I declare 'self' attributes in methods other than __init__ ? and are they accessible by external and internal?
thanks again for all the help out there! Everyone is very responsive....this is a great forum