Instance

2008-07-17 Thread 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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Instance

2008-07-22 Thread karthikbalaguru
On Jul 17, 5:34 pm, "Calvin Spealman" <[EMAIL PROTECTED]> wrote:
> On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru
>
> <[EMAIL PROTECTED]> wrote:
> > 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
--
http://mail.python.org/mailman/listinfo/python-list


tkinter for my python program !!

2008-07-22 Thread karthikbalaguru
Hi,

One of my python program needs tkinter to be installed to run
successfully.
I am using Redhat 9.0 and hence tried installing by copying the
tkinter-2.2.2-36.i386.rpm
alone from the CD 3 to my pc. But, it is not getting installed and is
failing by throwing
the below errors. Should i need to configure / install any specific
files for resolving this issue ?

[EMAIL PROTECTED] karthik]# rpm -ivh tkinter-2.2.2-26.i386.rpm
warning: tkinter-2.2.2-26.i386.rpm: Header V3 DSA signature: NOKEY,
key ID db42a
60e
error: Failed dependencies:
libtcl8.3.so is needed by tkinter-2.2.2-26.i386
libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
libtk8.3.so is needed by tkinter-2.2.2-26.i386

Any ideas ?

Thx in advans,
Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter for my python program !!

2008-07-22 Thread karthikbalaguru
On Jul 22, 6:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> karthikbalaguru wrote:
> > Hi,
>
> > One of my python program needs tkinter to be installed to run
> > successfully.
> > I am using Redhat 9.0 and hence tried installing by copying the
> > tkinter-2.2.2-36.i386.rpm
> > alone from the CD 3 to my pc. But, it is not getting installed and is
> > failing by throwing
> > the below errors. Should i need to configure / install any specific
> > files for resolving this issue ?
>
> > [EMAIL PROTECTED] karthik]# rpm -ivh tkinter-2.2.2-26.i386.rpm
> > warning: tkinter-2.2.2-26.i386.rpm: Header V3 DSA signature: NOKEY,
> > key ID db42a
> > 60e
> > error: Failed dependencies:
> > libtcl8.3.so is needed by tkinter-2.2.2-26.i386
> > libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
> > libtk8.3.so is needed by tkinter-2.2.2-26.i386
>
> > Any ideas ?
>
> Yes: you should consider reading error-messages. What does
>
> error: Failed dependencies:
>  libtcl8.3.so is needed by tkinter-2.2.2-26.i386
>  libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
>  libtk8.3.so is needed by tkinter-2.2.2-26.i386
>
> look like for you?
>
> Small hint: if you install something that depends on something else, you
> need to  the missing dependency first. Fill in the dots...
>

I find that it needs python-2.2.2-26.i386 and hence i tried installing
python and i
land here :( :(

[EMAIL PROTECTED] karthik]# rpm -ivh python-2.2.2-26.i386.rpm
warning: python-2.2.2-26.i386.rpm: Header V3 DSA signature: NOKEY, key
ID db42a60e
error: Failed dependencies:
libdb-4.0.so is needed by python-2.2.2-26.i386
python < 2.4.3-18.fc6 conflicts with python-
devel-2.4.3-18.fc6.i386
[EMAIL PROTECTED] karthik]#


I find that python 2.4.3-18.fc6 is being used by many of applications.
But, the program i am trying to run needs python-2.2.2-26.
So, how to resolve this issue ?

Thx in advans,
Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter for my python program !!

2008-07-22 Thread karthikbalaguru
On Jul 22, 7:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> karthikbalaguru wrote:
> > On Jul 22, 6:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> >> karthikbalaguru wrote:
> >> > Hi,
>
> >> > One of my python program needs tkinter to be installed to run
> >> > successfully.
> >> > I am using Redhat 9.0 and hence tried installing by copying the
> >> > tkinter-2.2.2-36.i386.rpm
> >> > alone from the CD 3 to my pc. But, it is not getting installed and is
> >> > failing by throwing
> >> > the below errors. Should i need to configure / install any specific
> >> > files for resolving this issue ?
>
> >> > [EMAIL PROTECTED] karthik]# rpm -ivh tkinter-2.2.2-26.i386.rpm
> >> > warning: tkinter-2.2.2-26.i386.rpm: Header V3 DSA signature: NOKEY,
> >> > key ID db42a
> >> > 60e
> >> > error: Failed dependencies:
> >> > libtcl8.3.so is needed by tkinter-2.2.2-26.i386
> >> > libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
> >> > libtk8.3.so is needed by tkinter-2.2.2-26.i386
>
> >> > Any ideas ?
>
> >> Yes: you should consider reading error-messages. What does
>
> >> error: Failed dependencies:
> >>  libtcl8.3.so is needed by tkinter-2.2.2-26.i386
> >>  libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
> >>  libtk8.3.so is needed by tkinter-2.2.2-26.i386
>
> >> look like for you?
>
> >> Small hint: if you install something that depends on something else, you
> >> need to  the missing dependency first. Fill in the dots...
>
> > I find that it needs python-2.2.2-26.i386 and hence i tried installing
> > python and i
> > land here :( :(
>
> > [EMAIL PROTECTED] karthik]# rpm -ivh python-2.2.2-26.i386.rpm
> > warning: python-2.2.2-26.i386.rpm: Header V3 DSA signature: NOKEY, key
> > ID db42a60e
> > error: Failed dependencies:
> > libdb-4.0.so is needed by python-2.2.2-26.i386
> > python < 2.4.3-18.fc6 conflicts with python-
> > devel-2.4.3-18.fc6.i386
> > [EMAIL PROTECTED] karthik]#
>
> > I find that python 2.4.3-18.fc6 is being used by many of applications.
> > But, the program i am trying to run needs python-2.2.2-26.
> > So, how to resolve this issue ?
>
> Are you *sure* it requires python2.2? If yes, why can't fedora install
> several python versions together? Ubuntu for sure can. But Python2.2 is
> *ancient* - you might need to compile it yourself.
>

I did the following to resolve the errors, many errors
got resolved, but finally the python program is breaking
with different error.

I got the below errors when i invoked the python program -

[EMAIL PROTECTED] processor]# Analyzer
   The python module Tkinter is not installed properly.
   Tkinter is required for this program.
  Redhat 9
You need tkinter-2.2.2-26. This can be found on the Redhat
install CD 3
$ rpm -i /mnt/cdrom/RedHat/RPMS/tkinter-2.2.2-26.i386.rpm


When i tried to install tkinter, i got the below errors -

[EMAIL PROTECTED] karthik]# rpm -ivh tkinter-2.2.2-26.i386.rpm
warning: tkinter-2.2.2-26.i386.rpm: Header V3 DSA signature:
NOKEY,
key ID db42a60e
error: Failed dependencies:
   libtcl8.3.so is needed by tkinter-2.2.2-26.i386
   libtix8.1.8.3.so is needed by tkinter-2.2.2-26.i386
   libtk8.3.so is needed by tkinter-2.2.2-26.i386

To resolve the conflicts and bring up the python program.
I did the following -

I downloaded python-devel-2.2.2-26.i386.rpm &
python-2.2.2-26.i386.rpm.
[EMAIL PROTECTED] karthik]# rpm -e --nodeps python-
devel-2.4.3-18.fc6.i386
[EMAIL PROTECTED] karthik]# rpm -e --nodeps python-2.4.3-18.fc6
[EMAIL PROTECTED] karthik]# rpm -ivh python-devel-2.2.2-26.i386.rpm
 warning: python-devel-2.2.2-26.i386.rpm: Header V3 DSA signature:
NOKEY, key ID db42a60e
 Preparing...
### [100%]
1:python-devel
### [100%]

[EMAIL PROTECTED] karthik]# rpm -ivh python-2.2.2-26.i386.rpm
 warning: python-2.2.2-26.i386.rpm: Header V3 DSA signature:
NOKEY, key ID db42a60e
 error: Failed dependencies:  libdb-4.0.so is needed by
python-2.2.2-26.i386

To resolve the above dependency error , i downloaded
db4-4.0.14-20.i386.rpm
But, i got the below errors while installing -

[EMAIL PROTECTED] karthik]# rpm -ivh db4-4.0.14-20.i386.rpm
 warning: db4-4.0.14-20.i386.rpm: Header V3 DSA signature: NOKEY,
key ID db42a60e
 Preparing...
### [100%]
 package db4-4.3.29-9.fc6 (which i

Strange problem ....

2008-07-23 Thread karthikbalaguru
Hi,

I am new to python, Kindly suggest to resolve a problem with a python
file.
What does the below error refer to ?
I use Redhat 9.0, python-2.2.2-26, python-devel-2.2.2-26 and
db4-4.0.14-20.

[EMAIL PROTECTED] processor]# Analyzer processorcycle
/usr/local/SDK/bin/../core/bin/processorlib.py:8
8: Warning: 'yield' will become a reserved keyword in the future
Traceback (most recent call last):
  File "/usr/local/SDK/bin/Analyzer", line 48, in ?
from debuglib import ProcessorInfo
  File "/usr/local/SDK/bin/../core/bin/processorlib.py", line 88
yield ProcessorObjectInfo(child, self.pt)
^
SyntaxError: invalid syntax

Is this error related with the version of python / python-devel that i
use .
Any ideas / tips ?

Thx in advans,
Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list


Re: Strange problem ....

2008-07-23 Thread karthikbalaguru
On Jul 23, 1:31 pm, "Simon Brunning" <[EMAIL PROTECTED]> wrote:
> 2008/7/23 karthikbalaguru <[EMAIL PROTECTED]>:
>
> > I use Redhat 9.0, python-2.2.2-26, python-devel-2.2.2-26 and
> > db4-4.0.14-20.
>
> >  File "/usr/local/SDK/bin/../core/bin/processorlib.py", line 88
> >yield ProcessorObjectInfo(child, self.pt)
> >^
> > SyntaxError: invalid syntax
>
> > Is this error related with the version of python / python-devel that i
> > use .
> > Any ideas / tips ?
>
> Yup - generators (and hence the yield statement) were first introduced
> in Python 2.2, but in order to maintain backward compatibility, you'll
> need this line in any module using them:
>
> from __future__ import generators
>
> As of Python 2.3, this is no longer necessary, and I'd imagine that
> whatever you are running was targeted at a post 2.2 release.
>

Your answers helped me to solve the problem.

I found some while loop inside def children(def).

I initially tried by putting 'from __future__ import generators'
just before the
 def children(self):
present inside the class definition of 'DebugProcessorInfo'. But it
did not work.

Later i placed the 'from __future__ import generators' at the
beginning
of the python file and it worked sucessfully.

Thx for that info.
Karthik Balaguru

--
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter for my python program !!

2008-07-23 Thread karthikbalaguru
On Jul 23, 11:38 pm, David <[EMAIL PROTECTED]> wrote:
> > Further, finally when i invoke the python program by
> > giving the necessary input file, i get the following
> > errors .
> > Does it have any relation with the python version installed ?
>
> yes
>
> > I am using Redhat 9.0
>
> You may want to install a current Linux distro.

I got the info from this usenet group. Thx for that info.

The problem got resolved after including 'from __future__ import
generators'
in the beginning of the file.

Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list


Requires a character ... !!

2008-07-24 Thread karthikbalaguru
Hi,

I am new to python . I am face few problems related with
python and iam trying to resolve it.

The below is the error that i get when i invoke my application by
giving
the necessary input file.

[EMAIL PROTECTED] hello]# Analyzer hello_input
Loading debug info: hello_input
Traceback (most recent call last):
  File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
app.dbg.readObjectInfo(elf)
  File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
readObjectInfo
 self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
  File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
readDwarfTree
if "DW_OP_reg" in value:
TypeError: 'in ' requires character as left operand

Is this related with the version conflicts ?
Should i need to configure any environment variables or change some
source code.
Any ideas ?

Thx in advans,
Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list


Re: Requires a character ... !!

2008-07-24 Thread karthikbalaguru
On Jul 24, 2:20 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> karthikbalaguru wrote:
> > I am new to python . I am face few problems related with
> > python and iam trying to resolve it.
>
> > The below is the error that i get when i invoke my application by
> > giving
> > the necessary input file.
>
> > [EMAIL PROTECTED] hello]# Analyzer hello_input
> > Loading debug info: hello_input
> > Traceback (most recent call last):
> >   File "/usr/local/SDK/host/bin/Analyzer", line 694, in ?
> > app.dbg.readObjectInfo(elf)
> >   File "/usr/local/SDK/host/bin/debugprocessor.py", line 427, in
> > readObjectInfo
> >  self.privateProcessorDwarfTree.readProcessorDwarfTree(filename)
> >   File "/usr/local/SDK/bin/debugprocessor.py", line 314, in
> > readDwarfTree
> > if "DW_OP_reg" in value:
> > TypeError: 'in ' requires character as left operand
>
> > Is this related with the version conflicts ?
> > Should i need to configure any environment variables or change some
> > source code.
>
> You should run the code on a Python version that supports the features
> your code is using.  Support for arbitrary strings on the left side of
> the "in" operator was added in Python 2.3, which was released in 2003.
>

Thx for that info. I understand.
The requirements state that it needs Python 2.2, But i wonder
how that program has been implemented using Python 2.3 features.
Anyhow, this has to be resolved and i need your help.

Kindly let me know a trick to make to resolve
the 'in' operator related problem by using Python 2.2.

Thx in advans,
Karthik Balaguru
--
http://mail.python.org/mailman/listinfo/python-list