cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Rajat
Level IV

.jsl Script call from Python

I prepared a data in python and call jsl script from python and use the output in python again. How can I do that.

8 REPLIES 8
txnelson
Super User

Re: .jsl Script call from Python

JMP documentation on OLE Automation points to a .PDF file that documents examples on calling JMP from external programs. The PDF can be found the install directory structure for your JMP install
…...JMP/14/Documentation
Jim
Rajat
Level IV

Re: .jsl Script call from Python

Thanks @txnelson.
It's a detailed document on OLE Automation but still I am not able to run my jsl script .
I have a jsl script which will generate plots and save to a particular location. I want to call this script from python and in back-end, it will run the script in JMP and save the plots. Can tell me command for the same in python.
Thanks

Re: .jsl Script call from Python

As was mentioned, driving JMP using automation.  From Python you would need to load one of the Python to COM packages to allow interoperating with JMP's COM automation layer.  Second, would be to launch a JMP process from Python, as if you were launching from the command line with the .jsl script as a command line parameter (I believe this should work, but have not tested).  And lastly you could write a JSL script that listens on a socket and lets you send commands to JMP across the socket.  However you couldn't just send the JSL, since JSL isn't multi-threaded, and it's your script that's maintaining the socket.  Your socket handling script would have parse the recieved data and issues the jsl commands from within it's script.

 

Python support is currently only one way.  JMP can acess python modules and pass data to the running python script and retrieve that data, because it is accessing data in the JMP launched python interpreter.  At present there is no

import jmp 

functionality which would allow you to call into JMP from a seperately launched Python instance.

Rajat
Level IV

Re: .jsl Script call from Python

Thanks @Paul_Nelson.
I wish if this could be future enhancement to call JMP from python.
txnelson
Super User

Re: .jsl Script call from Python

Please add this request to the JMP Wish List
Jim
vchivukula
Level I

Re: .jsl Script call from Python

+ 1 I would like this to be added as well. 

nascif_jmp
Level VI

Re: .jsl Script call from Python

Craige_Hales
Super User

Re: .jsl Script call from Python

Try this:

>>> import subprocess
>>> subprocess.call(['C:\\space\\SAS\\JMP\\15\\jmp.exe', 'C:\\Users\\v1\\Desktop\\test.jsl'])

The test.jsl file should 

  • read a file that your Python program wrote before the call to get data
  • process
  • write a file of answers
  • quit();

the Python program can read the file after the call returns. You might want to use CSV files in both directions; JMP and Python can read and write them.

Craige