A
ajikoe
Hello,
I'm new to python,
How can I access private field in python.
thanks
I'm new to python,
How can I access private field in python.
thanks
Hello,
I'm new to python,
How can I access private field in python.
thanks
Hello, if we want to access the private member of object we use the
classname, it doesn't make sense. For example:
I have class A:
class A:
def __init__(self, i):
self.__i = i;
pass
__i = 0
a = A(22);
b = A(33);
How can I get field i in object a and how can I get field i in object
b?
Beside I try to call:
print _A__i #fail this create error
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.