cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

How to return a list of strings from a python script to JSL

Hi 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

1 REPLY 1

Re: How to return a list of strings from a python script to JSL

This 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"};

Recommended Articles