cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

How to pass arguments from Python to jmp script while running the jsl from python ?

Hi all,

Does anyone have any pointers on how to pass arguments from python to a jump script (JMP15) ? Eg. I want to pass a file location to JMP to get a datatable , jsl will use this argument string to process the datatable.

This python script will be calling the jump script .jsl file using subprocess. 

 

3 REPLIES 3
Craige_Hales
Super User

Re: How to pass arguments from Python to jmp script while running the jsl from python ?

Pass argument when running script from command linediscussed this for the powershell caller; I think you can set the environment variable in python and retrieve it in JMP. Please post back with a short how-to if it works, thanks!

 

@jschroedl 

Craige

Re: How to pass arguments from Python to jmp script while running the jsl from python ?

Thanks for sharing. I had seen it but was thinking if there was any direct way to pass to jmp function/script as the environment variable may change in remote system or different platforms. 

 

Anyway an example of how to do it in Python :

 

Python script to invoke the JMP15 exe with the full JSL script path(script_file_jmp_name) : 

import os
import subprocess
os.environ['ScriptArg'] = "This is a string variable passed"
subprocess.call(["C:\Program Files\SAS\JMP\15\jmp.exe", script_file_jmp_name])

 

JSL :

Open Log();
myvar = Get Environment Variable("ScriptArg");
print(myvar);
quit();
Craige_Hales
Super User

Re: How to pass arguments from Python to jmp script while running the jsl from python ?

Agree, there should be a JMP command line option to supply some JSL. @Wendy_Murphrey 

Can JMP run JMP?wrote a custom JSL file for each copy of JMP it launched.

 

edit: perfect example!

Craige