Reputation: 51
I am trying to call a ExecutionStart function by the Object TestSessionProjectObj
. When i pass and try to print the object it shows the below error CoIntilaization
.
File "C:\Python27\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File"C:/AI/AutomationDesk/API/Scripting_Python/MITETestSessionProjectExecution.py", line 52, in ExecutionStart
print TestSessionProjectObj.Name
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 529, in getattr
ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1)
com_error: (-2147221008, 'CoInitialize has not been called.', None, None)
Upvotes: 3
Views: 8831
Reputation: 3186
Just try by adding this :
import pythoncom
pythoncom.CoInitialize()
.....
Upvotes: 4