For the latest version of JMP Help, visit JMP.com/help.


JSL Syntax Reference > JSL Messages > Python Integration Messages
Publication date: 04/21/2023

Python Integration Messages

The Python interfaces are also scriptable using a Python connection object. A scriptable Python connection object can be obtained using the Python Connect() function. See Python Connect(<Echo(Boolean),> <Path(path),> <Use Python Version(string),> <Python System Path(list)>).

pythconn<<Control(<Interactive(Boolean)>|<Echo(Boolean)>)

Description

Controls the execution of Python.

Optional Named Arguments

Interactive(Boolean)

Enables interactive mode in the Python matplotlib package. Determines whether the graphics window is released or closed when graphics rendering is complete.

Echo(Boolean)

Global argument. Prints the Python source lines to the JMP log. The default value is true.

pythconn<<Disconnect

Disconnects the Python integration interface connection.

pythconn<<Execute({list of inputs}, {list of outputs}, Python code, <named arguments>)

Description

Submits Python code to the active global Python integration interface connection given a list of inputs. On completion, returns a list of outputs.

Returns

Returns 0 if successful and 1 otherwise. The results are returned using the list of outputs. Given each element of the JMP output list, the corresponding Python variable value is returned.

Positional Arguments

{list of inputs}

A list of JMP variable names to be sent to Python as inputs.

{list of outputs}

A list of JMP variable names to be retrieved from Python as outputs.

Python code

The quoted Python code to submit.

Optional Named Arguments

See pythconn<<Submit(Python code, <Expand(Boolean)>, <Echo(Boolean)>).

pythconn<<Get(name)

Description

Gets a named variable from Python.

Returns

Returns the value of the named variable.

Argument

name

The name of the JMP variable to be received from Python. The argument can represent any of the following Python data types: numeric, quoted string, matrix, list, or data frame.

pythconn<<Get Graphics(format)

Description

Gets the last graphics object written to the Python graph display window in the specified graphics format. The graphics object can be returned in several different graphic formats.

Returns

Returns a JMP picture object.

Argument

format

The format that the Python graph display window contents are to be converted to. Valid formats are PNG, BMP, JPEG, JPG, TIFF, and TIF.

pythconn<<Get Version

Description

Gets the current version of the Python installation.

Returns

Returns a list of length 5 that contains the five components of the version number: major, minor, micro, releaselevel, and serial. The releaselevel value is a quoted string.

pythconn<<Is Connected

Description

Determines if the connection is active.

Returns

Returns 1 if connected and 0 otherwise.

pythconn<<JMP Name to Python Name(name)

Description

Maps a JMP variable name to its corresponding Python variable name using Python variable name naming rules.

Argument

name

The name of the JMP variable to be sent to Python. Some variable names allowed by JMP are not allowed by Python. When you send using these variables from JMP to Python (the Send message), their names get changed. Use JMP Name to Python Name to determine what the variable name was changed to.

pythconn<<Send(name)

Description

Sends a named variable from JMP to Python.

Returns

Returns 0 if successful and non-zero otherwise.

Argument

name

The name of the JMP variable to be sent to Python.

pythconn<<Submit(Python code, <Expand(Boolean)>, <Echo(Boolean)>)

Description

Submits Python code to the active global Python integration interface connection.

Returns

Returns 0 if successful and 1 otherwise.

Required Arguments

Python code

The quoted Python code to submit.

Optional Arguments

Expand(Boolean)

Performs an Eval Insert() on the Python code before submission.

Echo(Boolean)

Prints the Python source lines to the JMP log. The default value is true.

pythconn<<Submit File(path)

Description

Submits statements to Python using the quoted path name.

Argument

path

The quoted path to the file that contains the Python source lines to be executed.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).