Re: COM Error -- Urgent help
Hi! .func( is not defined... @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Méta-MCI wrote: Hi! .func( is not defined... @-salutations -- Michel Claveau I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help me out... Thnks, Teja.P -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Teja wrote: I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help me out... nobody here can read your mind. please post the code you're actually using, *and* the error you're getting. /F -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Fredrik Lundh wrote: Teja wrote: I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help me out... nobody here can read your mind. please post the code you're actually using, *and* the error you're getting. /F Thnks for your immediate reply. Here is the code: I have a class GenericFunctions which is defined as follows: import win32com.client, pythoncom, thread ie=win32com.client.Dispatch('internetexplorer.application') 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() def threadFunction(self,dest): pythoncom.CoInitialize() d=pythoncom.CoGetInterfaceAndReleaseStream(s, pythoncom.IID_IDispatch) my_ie=win32com.client.Dispatch(d) obj.MyNavigate(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') I am getting an attribute error -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Dennis Lee Bieber wrote: On 17 Oct 2006 00:58:59 -0700, Teja [EMAIL PROTECTED] declaimed the following in comp.lang.python: thread.start_new_thread(self.nav, (s,'www.google.com') I am getting an attribute error That can not be the REAL code... I'd expect a syntax error... You have mismatched parens on that line! -- WulfraedDennis Lee Bieber KD6MOG [EMAIL PROTECTED] [EMAIL PROTECTED] HTTP://wlfraed.home.netcom.com/ (Bestiaria Support Staff: [EMAIL PROTECTED]) HTTP://www.bestiaria.com/ Hi, Ya its a copy paste error... But can u please let me know what is the reason for attribute error and how to rectify it?? Thnks, Regards Teja.P -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Teja wrote: s=pythoncom.CoMarshalInterThreadInterfaceInStream(pythoncom.IID_IDispatch,ie) thread.start_new_thread(self.nav, (s,'www.google.com') I am getting an attribute error the traceback tells you what attribute Python was looking for, and may also provide additional clues. can you post the traceback too? make sure you include all of it. /F -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Teja wrote: Dennis Lee Bieber wrote: On 17 Oct 2006 00:58:59 -0700, Teja [EMAIL PROTECTED] declaimed the following in comp.lang.python: thread.start_new_thread(self.nav, (s,'www.google.com') I am getting an attribute error That can not be the REAL code... I'd expect a syntax error... You have mismatched parens on that line! -- Wulfraed Dennis Lee Bieber KD6MOG [EMAIL PROTECTED][EMAIL PROTECTED] HTTP://wlfraed.home.netcom.com/ (Bestiaria Support Staff:[EMAIL PROTECTED]) HTTP://www.bestiaria.com/ Hi, Ya its a copy paste error... But can u please let me know what is the reason for attribute error and how to rectify it?? How many times need you a beating with a clue-stick? Post the _actual_ code, not something that closely resembles it - in _your_ opinion Post the error message And before you do all this, read: http://www.catb.org/~esr/faqs/smart-questions.html Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Diez B. Roggisch wrote: Teja wrote: Dennis Lee Bieber wrote: On 17 Oct 2006 00:58:59 -0700, Teja [EMAIL PROTECTED] declaimed the following in comp.lang.python: thread.start_new_thread(self.nav, (s,'www.google.com') I am getting an attribute error That can not be the REAL code... I'd expect a syntax error... You have mismatched parens on that line! -- Wulfraed Dennis Lee Bieber KD6MOG [EMAIL PROTECTED][EMAIL PROTECTED] HTTP://wlfraed.home.netcom.com/ (Bestiaria Support Staff:[EMAIL PROTECTED]) HTTP://www.bestiaria.com/ Hi, Ya its a copy paste error... But can u please let me know what is the reason for attribute error and how to rectify it?? How many times need you a beating with a clue-stick? Post the _actual_ code, not something that closely resembles it - in _your_ opinion Post the error message And before you do all this, read: http://www.catb.org/~esr/faqs/smart-questions.html Diez OK Ok .. Here is the final code thats giving an error: GenericFunctions.py -- import win32com.client, pythoncom, thread ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 class GenericFunctions: def __init__(self): print In Constructor of Generic Functions def MyNavigate(self,dest): ie.Navigate(dest) --- MainThread.py -- import win32com.client, pythoncom, thread from GenericFunctions import * obj = GenericFunctions() import sys,traceback def threadFunction(s,dest): pythoncom.CoInitialize() try: d=pythoncom.CoGetInterfaceAndReleaseStream(s, pythoncom.IID_IDispatch) my_ie=win32com.client.Dispatch(d) #d.MyNavigate(dest) obj.MyNavigate(dest) # this is gving an error. except: my_ie = None print traceback.print_exc(file= sys.stdout) pythoncom.CoUninitialize() if __name__ == __main__: s=pythoncom.CoMarshalInterThreadInterfaceInStream(pythoncom.IID_IDispatch,ie) thread.start_new_thread(threadFunction, (s,'www.google.com')) - And here is the error: Traceback (most recent call last): File C:\Documents and Settings\dzxbrn\Desktop\Stop Test\13 Oct\MainThread.py, line 13, in threadFunction obj.MyNavigate(dest) # this is gving an error. File C:\Documents and Settings\dzxbrn\Desktop\Stop Test\13 Oct\GenericFunctions.py, line 9, in MyNavigate ie.Navigate(dest) File C:\Python24\Lib\site-packages\win32com\client\dynamic.py, line 489, in __getattr__ raise AttributeError, %s.%s % (self._username_, attr) AttributeError: internetexplorer.application.Navigate None This is highly urgent and important... Please help me out Thnks Regards, Tejovathi.P -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
Teja: ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 class GenericFunctions: def __init__(self): print In Constructor of Generic Functions def MyNavigate(self,dest): ie.Navigate(dest) You are using an interface created on the main thread here. ... d=pythoncom.CoGetInterfaceAndReleaseStream(s, pythoncom.IID_IDispatch) my_ie=win32com.client.Dispatch(d) #d.MyNavigate(dest) obj.MyNavigate(dest) # this is gving an error. After all the trouble of marshalling the interface into this thread you aren't using it. Pass my_ie to MyNavigate. I also had some errors before changing from thread to threading. Neil -- http://mail.python.org/mailman/listinfo/python-list
Re: COM Error -- Urgent help
This is the trae back ,can you help me please. Traceback (most recent call last): File C:\Documents and Settings\dzxbrn\Desktop\Stop Test\13 Oct\MainThread.py, line 13, in threadFunction obj.MyNavigate(dest) # this is gving an error. File C:\Documents and Settings\dzxbrn\Desktop\Stop Test\13 Oct\GenericFunctions.py, line 9, in MyNavigate ie.Navigate(dest) File C:\Python24\Lib\site-packages\win32com\client\dynamic.py, line 489, in __getattr__ raise AttributeError, %s.%s % (self._username_, attr) AttributeError: internetexplorer.application.Navigate None Fredrik Lundh wrote: Teja wrote: s=pythoncom.CoMarshalInterThreadInterfaceInStream(pythoncom.IID_IDispatch,ie) thread.start_new_thread(self.nav, (s,'www.google.com') I am getting an attribute error the traceback tells you what attribute Python was looking for, and may also provide additional clues. can you post the traceback too? make sure you include all of it. /F -- http://mail.python.org/mailman/listinfo/python-list