How to return a list of strings from a python script to JSLHi I've got a small python script that has some user entry fields and uses to create some SQL scripts, I want these to then be run through jmp.
Currently the JSL file is:
Python Submit File( "python.py" );
query_list = Python Get( list );
show(query_list)
The python script is running as intended as if I print (list) in python it'll show the list of queries in the log.
I've also tried turning the list (in python) to a dataframe and a jmp.datatable
Automation and ScriptingRe: How to return a list of strings from a python script to JSLThis is handled automatically, Python Get( variable_name ) retrieves the variable from the Python environment. A Python list is returned as a JSL List. 'list' is a Python keyword.
python.py
import jmp
my_list = ['query1','query2','query3']
Names Default to Here(1);
Python Submit File("python.py");
query_list = Python Get(my_list);
show(query_list);
Results:
...
query_list = Python Get(my_list);
show(query_list);
/*:
query_list = {"query1", "query2", "query3"};