cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Isaac2
Level I

Python tkinter library

Is there a way to use the python tkinter library. If I try to import it I just get an error message saying it doesn't exist.

2 REPLIES 2
jthi
Super User

Re: Python tkinter library

See this reply by Paul RE: Is there a list of python library names in JMP18.0.0? 

 

Bolding added by me

The only 'installed' libraries are the standard libraries distributed with a stock Python.org Python 3.11.x minus a select few that may not play well within the embedded environment. These most notably: venv, and tkinter. And a few trivial ones like turtle and hello.
-Jarmo

Re: Python tkinter library

The issue is that TkInter and other GUI libraries for Python are assuming Python is in control of the main program's 'run loop' but in the case of embedded Python, the host application ( JMP ) is the one in control of the Main GUI's event loop.  This causes all kinds of issues, mostly instability and crashes as the two are fighting for control of the event loop.  Opening a Tk window, ( or even a matplotlib window ) is often fine a long as you never close the window while JMP is still running...  Close the window, you can get multiple issues.  I have seen all of these: JMP exiting because the Python UI decided last window closed should exit the application, but that's JMP; corruption of menu system in JMP as the Python UI causes other resources to be freed as window closes; and just plain crashing soon after.

 

One of the things that is being explored is bringing up JMP UI windows to draw within and add controls.  I have already done example code in 18 where using run_jsl() a file picker dialog is raised. JMP Python in integration controlling JMP windows does not have the same issues as an external UI that thinks Python is in full control.