468,284 Members | 1,580 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,284 developers. It's quick & easy.

Attribute error

Hi all,

What is attribute error? what causes that error, especially with COM
objects?

To be precise :

Attribute Error: LCAS.LabcarController.writeLogWindow()

Here, LCAS.... is a COM object

Thanks
Teja.P

Oct 14 '06 #1
3 1408
"Teja" <te*********@gmail.comwrites:
What is attribute error?
exception AttributeError
Raised when an attribute reference or assignment fails.

<URL:http://docs.python.org/lib/module-exceptions.html#l2h-103>
To be precise :
Not precise enough, unfortunately. Please construct a minimal,
complete example that demonstrates the behaviour (and does nothing
except what's needed to demonstrate the behaviour), and post its code
along with a traceback output.

--
\ "He who allows oppression, shares the crime." -- Erasmus |
`\ Darwin, grandfather of Charles Darwin |
_o__) |
Ben Finney

Oct 14 '06 #2
"Teja" <te*********@gmail.comwrote:
Hi all,

What is attribute error? what causes that error, especially with COM
objects?

To be precise :

Attribute Error: LCAS.LabcarController.writeLogWindow()

Here, LCAS.... is a COM object

Thanks
Teja.P
LabcarController might be a function. See:

http://groups.google.com/group/comp....341f1aedcae6d3

for more detail.

hope this helps,
max

Oct 14 '06 #3

Max Erickson wrote:
"Teja" <te*********@gmail.comwrote:
Hi all,

What is attribute error? what causes that error, especially with COM
objects?

To be precise :

Attribute Error: LCAS.LabcarController.writeLogWindow()

Here, LCAS.... is a COM object

Thanks
Teja.P

LabcarController might be a function. See:

http://groups.google.com/group/comp....341f1aedcae6d3

for more detail.

hope this helps,
max

HI all,

I have a problem in accesing COM objects in threads. To be precise,
lets assume that I have a class GenericFunctions which is defined as
follows:

import win32com.client, pythoncom, thread
ie=win32com.client.Dispatch('internetexplorer.appl ication')
ie.Visible=1

class GenericFunctions:

def __init__(self):
print "In Constructor of Generic Functions"

def MyNavigate(self,dest):
ie.Navigate(dest)
Now there is another file Main.py which is defined as follows:

import win32com.client, pythoncom, thread
from GenericFunctions import *
obj = GenericFunctions()

class Mainclass:
def __init__(self);
print "In Constructor of Main class"

def threadFunction(self,dest):
pythoncom.CoInitialize()
d=pythoncom.CoGetInterfaceAndReleaseStream(s,
pythoncom.IID_IDispatch)
my_ie=win32com.client.Dispatch(d)
obj.func(dest) # this is gving an error.
pythoncom.CoUninitialize()

if __name__ == "__main__":

s=pythoncom.CoMarshalInterThreadInterfaceInStream( pythoncom.IID_IDispatch,ie)
thread.start_new_thread(self.nav, (s,'www.google.com')

Basically, I want to access object of GenericFunctions class inside
threadFunction(). However I was able to execute
my_ie.Navigate("google.com"). But that was not I wanted. I am not
knowing where the error is....
Please let me know the solution ASAP...

Teja.P

Oct 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Manuel Faux | last post: by
2 posts views Thread by Keith Chadwick | last post: by
reply views Thread by Doug Bailey | last post: by
3 posts views Thread by Peter Seif | last post: by
3 posts views Thread by Andy | last post: by
2 posts views Thread by BiraRai | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.