Dec-04-2018, 09:11 AM
It's not quite clear what you want to achieve. As is
Let's assume your Cycler code does not have do method at all. You can do follwoing
My_ref
from your code is not visible/accessible outside Cycler.do()
method.Let's assume your Cycler code does not have do method at all. You can do follwoing
class Cycler(object): def __init__(self, data): self.data = data # create instance of class Cycler cycler = Cycler(2) #access instance property data print(cycler.data) #change instance property data cycler.data = 5 #access instance property data again print(cycler.data)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs