Instance

K

karthikbalaguru

Hi,

I am new to python. I am trying to use the python files given to me
for bringing up a setup.
I get the following error while trying to use a python file -
AttributeError : Classroom instance has no attribute 'desk_offset'

How to resolve this ?
Should i need to define desk_offset to zero in the python file ?

Any ideas ..

Thx in advans,
Karthik Balaguru
 
J

Jeroen Ruigrok van der Werven

-On [20080717 09:01] said:
AttributeError : Classroom instance has no attribute 'desk_offset'

You are using a Classroom instance and probably assigning something to the
instance's variable/attribute 'desk_offset'. Except that the class Classroom
has no self.desk_offset.

So in your class definition you would need to add something to __init__()
like:

self.desk_offset = None # or 0 or...
 
C

Calvin Spealman

Hi,

I am new to python. I am trying to use the python files given to me
for bringing up a setup.
I get the following error while trying to use a python file -
AttributeError : Classroom instance has no attribute 'desk_offset'

How to resolve this ?
Should i need to define desk_offset to zero in the python file ?

Any ideas ..

This means you did something like this:

class Foo:
def __init__(self):
self.bar = 10

f = Foo()
print f.quu
....
AttributeError : Foo instance has no attribute 'quu'

See? You tried to use an attribute that simply doesn't exist. Look in
the traceback for where you used the desk_offset attribute, and figure
out why you thought the object had such an attribute and why it does
not.
 
K

karthikbalaguru

This means you did something like this:

class Foo:
def __init__(self):
self.bar = 10

f = Foo()
print f.quu
...
AttributeError : Foo instance has no attribute 'quu'

See? You tried to use an attribute that simply doesn't exist. Look in
the traceback for where you used the desk_offset attribute, and figure
out why you thought the object had such an attribute and why it does
not.

Thx!! Your ideas were useful.
I read some basic lessons on python and that were also very helpful in
solving
the problem.

Thx ,
Karthik Balaguru
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top