How to call the existing object in python
I have this kind of code.
class typeOne(self):
....
def run():
# I want to call the funct() from typeTwo
class typeTwo(self):
...
def funct():
...
class typePlayer(self):
...
tT = typeTwo()
...
tT.funct()
.....
I want to reference the typeTwo class from typeOne class that has been
called in the typePlayer.
I tried this one.
class typeOne:
....
mytT = typeTwo()
def run():
mytT.funct()
but it creates new typeTwo() class, I just only want to call the existing
typeTwo() class and not to create one.
does anyone has an idea about this?
No comments:
Post a Comment