Yigit Turgut wrote:
class test(test1):
def __init__(self, device):
.
.
.
def _something(self, x=1)
self.dt = data
if __name__ == "__main__":
test.something.dt ???
I am trying to call a variable located in a function of a class
dt is an attribute of an instance of the class.
t = test() #
Yigit Turgut wrote:
class test(test1):
def __init__(self, device):
.
.
.
def _something(self, x=1)
self.dt = data
if __name__ == "__main__":
test.something.dt ???
I am trying to call a variable located in a function of a class from
main but couldn't succeed
On Jan 7, 6:01 pm, Steven D'Aprano wrote:
> On Sat, 07 Jan 2012 07:00:57 -0800, Yigit Turgut wrote:
> > I am trying to call a variable located in a function of a class from
> > main but couldn't succeed.Any ideas?
>
> You cannot access local variables from outside their function. That's why
> they
On Sat, 07 Jan 2012 07:00:57 -0800, Yigit Turgut wrote:
> I am trying to call a variable located in a function of a class from
> main but couldn't succeed.Any ideas?
You cannot access local variables from outside their function. That's why
they are called *local* variables.
You probably want to
class test(test1):
def __init__(self, device):
.
.
.
def _something(self, x=1)
self.dt = data
if __name__ == "__main__":
test.something.dt ???
I am trying to call a variable located in a function of a class from
main but couldn't succeed.Any ideas?
--
http:/