Akshay
Akshay

Reputation: 903

How to call a *.jsl script from python script

I have a python script running. I want to call *.jsl script in my running python script and want to make use of it's output in python. May I know how can I do that?

Upvotes: 4

Views: 6889

Answers (3)

Byron Wingerd
Byron Wingerd

Reputation: 1

I'm on a Mac, and this works

import os
os.system('open /Applications/JMP\ Pro\ 13.app/Contents/MacOS/JMP /path/filename.jsl')

there is a space between the path/executable and the path/name.

In your JSL make sure the first line only has //! This will make the script auto-run when its opened. Also, use quit(); as the last line, that way the instance of JMP that is opened gets closed.

Reference this link on using os: How can I launch an instance of an application using Python?

Upvotes: -1

Rami
Rami

Reputation: 1

Make sure jmp.exe is available in your system environment so that if you type "jmp.exe" in the command line, it would launch jmp. Then have your *.jsl ready. use python procees to run this command "jmp.exe *.jsl" and that would open jmp and run the *.jsl script and then you can import whatever you generate from jmp back in to python.

Upvotes: 0

Dan Lenski
Dan Lenski

Reputation: 79782

You should take a look at the JMP automation guide.

You can automate JMP from Python using the win32com interface, which is unfortunately quite buggy and incomplete. I've written a custom library of code to work around these issues, largely because my job requires me to work with JMP extensively and its built-in programming language is awful at many things.

Upvotes: 5

Related Questions