[Tutor] Python to open a "example.jmp" file

Bassam Dourassi bdourass at gmail.com
Tue Jul 30 05:18:59 CEST 2013


I am trying to open a JMP file using python.
Here is the code I found online:
# -*- coding: cp1252 -*-
from win32com.client import Dispatch
jmp = Dispatch("JMP.Application")
doc = jmp.OpenDocument("C:/Users/bdourass/Desktop/Python/example.jmp")
doc.CreateOneWay

This is the error I get:

Traceback (most recent call last):
  File "C:\Users\bdourass\Desktop\Python\RunJMPusingPython.py", line 3, in
<module>
    jmp = Dispatch("JMP.Application")
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line
95, in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line
108, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 85,
in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Invalid class string', None, None)
>>>

I couldn't find much resources about the interaction between python and JMP
pro software online
All inputs are appreciated. Thanks in advance.
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130730/335f438b/attachment.html>


More information about the Tutor mailing list