Executing a python exe from Run program()I have a python executable (so I or others don't need python installed on the pc) which can analyze some data...
I would like to call and run this from JMP, but I am not sure the best way as I would like to be able to feed variables to this python exe from JMP as well as get the return.
I have done this successfully using the integrated python commands, but never with a stand along python exe file. One of the variables I'd need to feed in is a data table. Currently I'd need to have JMP save the table as a .csv in a temp location, then this python exe can run and edit that .csv ... then JMP can open the updated CSV (I don't have that stream coded in JSL as I feel there must be a better way)
Any thoughts? I have minimal experience with Run Command() so any starting pointers will be appreciated 
Thanks!
ScriptingRe: Executing a python exe from Run program()Using an executable built from a Python program via RunProgram, or calling the Python interpreter with the Python script from RunProgram is similar. Neither one has the integration that using the integrated Python has. You'll need to use something like a CSV file to send data to the Python program and to get data back from the Python program. You can also pass command line parameters to the .exe. (Or to the python interpreter.)
In your case I'd suggest writing the CSV to $temp directory and printing the results in python. Pass the csv path via the command line. Use RunProgram(...readfunction("text")...) to retrieve the string of printed output. delete the temp dir file.
Re: Executing a python exe from Run program()I've not done this and can't easily test it on my system at the moment, but it looks like you can read from an executable's stdout and write to an executable's stdin streams using JSL: https://community.jmp.com/kvoqx44227/attachments/kvoqx44227/discovery-2016-content/67/1/Run%20Program.pdf
Python can read from stdin (and output to stdout) as a file-like operation: Python - stdin, stdout, and stderr - AskPython
So I'm reasonably sure you could ` << Write` your data table line-by-line to the stdin of the executable from JMP, use a file-like method to read the lines from JMP in Python, construct those lines into a Pandas dataframe, run your Python operations, then output the Pandas dataframe line-by-line from Python to the stdout, feeding that back to JMP.
Re: Executing a python exe from Run program()@Michael_MXAK Hmm, that's also an interesting idea. For smaller files it may work fine. Some of these files may get rather large so that line by line method may not be overly efficient... It's great food for thought, though.
Re: Executing a python exe from Run program()@Craige_Hales Ok, that makes sense... that's where I was leaning, but outputting the information into the string for retrieval would be easier than a 2nd csv to deal with.