Technical Notes
Programming and other technical stuff
Monday, July 11, 2011
Accessing instance variable in Python
To access a Python instance variable outside the class:
class Sample:
def __init__(self, max):
self. max = max
....
sampleinstance = Sample(2)
max = sampleinstance.max
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment