473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Instance

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
Jul 17 '08 #1
3 945
-On [20080717 09:01], karthikbalaguru (ka***************@gmail.com) wrote:
>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...

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org/ asmodai
イェルーン ラウフãƒ*ック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
A frightened mental vortex we will be, a Sun we seek, a Sun we flee...
Jul 17 '08 #2
On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru
<ka***************@gmail.comwrote:
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.

--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://ironfroggy-code.blogspot.com/
Jul 17 '08 #3
On Jul 17, 5:34 pm, "Calvin Spealman" <ironfro...@gmail.comwrote:
On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru

<karthikbalagur...@gmail.comwrote:
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.
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
Jul 22 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Robert Ferrell | last post by:
I have a question about assigning __call__ to an instance to make that instance callable. I know there has been quite a bit of discussion about this, and I've read all I can find, but I'm still...
4
by: | last post by:
Hi I have a list containing several instance address, for example: I'd like to invoke a method on each of these instance but I don't know : 1. if its possible 2. how to proceed
18
by: John M. Gabriele | last post by:
I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I...
2
by: Mike | last post by:
Greetings, Having a major problem here. running version 8.2 on win2003 server. The problem I am having is backing up a database seems to get to the last part of the backup and then fails. This...
6
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? ...
6
by: Dmitry Karneyev | last post by:
Hi! I guess this question have been asked a lot of times, but please be tolerant and if you have any ideas share it. The question is: how to make availibale only one instance of application and...
2
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
1
by: vijay.db | last post by:
Hi Team, Very serious problem with my DB2 V8.1 Fixpack 6 running in AIX 5.1 machine. Every one hour my DB2 instance processes are killed and it's going down. Several trap files are generated in...
12
by: titan nyquist | last post by:
I have a class with data and methods that use it. Everything is contained perfectly THE PROBLEM: A separate thread has to call a method in the current instantiation of this class. There is...
1
by: gzeng | last post by:
I am creating a singleton class in C++. Everything is fine except with the object pointers. I cannot instaniate a regular object. But I can define many pointers *aaaa, *bbbb, etc. to the class and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.