EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Python Script call from Button press, module not found
From: "Manoussakis, Adamandios via Tech-talk" <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 15 Apr 2021 15:50:45 +0000
I did have one more question with regards to the execute command in the action button.  That technically is just calling a cmd line argument that I place there correct ( python example.py )?   Is there any way to trigger this based off a rule or is it only running the execute command when the button is clicked ?  

Thanks for your help

On Apr 15, 2021, at 6:03 AM, Kasemir, Kay <kasemirk at ornl.gov> wrote:


Hi:

Yes, jython is still different from CPython, so Numpy and the like which call out to native C or even fortran code cannot be used from jython.

might have to go the pythonIoc route 
That's definitely a better idea. Scripts in the display, if used at all, should be limited to simple task, certainly not for number crunching based on numpy/pandas. That's better moved into a service (IOC, pcaspy, ..).


From: Manoussakis, Adamandios <manoussakis1 at llnl.gov>
Sent: Thursday, April 15, 2021 1:59 AM
To: Kasemir, Kay <kasemirk at ornl.gov>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] RE: Python Script call from Button press, module not found
 

Hi Kay,

 

Thanks for the link, I tried adding to my settings.ini file but still doesn’t seem to be finding the packages I am importing in my script (pandas, numpy).

 

org.csstudio.display.builder.runtime/python_path=C:\Users\PC\AppData\Local\Programs\Python\Python39\

 

I did find a fairly old post by you on tech talk and was wondering if this still applied to Phoebus/Jython (seems like jython still doesn’t work with numpy from looking around)

 

“CSS BOY scripts are executed in jython, not python.

Most of the default python modules are also available in jython, but when you install python modules with binary dependencies like numpy, MySQL_python, .. those are not available in jython.”

 

If this is the case, it seems like I might have to go the pythonIoc route but I really just wanted to have the script get called when a pv changed value (was using the button to write a value change causing the script to trigger).

 

 

 

Thanks,

Adam

 

 

 

 

 

 

From: Kasemir, Kay <kasemirk at ornl.gov>
Sent: Wednesday, April 14, 2021 10:41 AM
To: tech-talk at aps.anl.gov; Manoussakis, Adamandios <manoussakis1 at llnl.gov>
Subject: Re: Python Script call from Button press, module not found

 

 


Replies:
Re: Python Script call from Button press, module not found Manoussakis, Adamandios via Tech-talk
Re: [EXTERNAL] Python Script call from Button press, module not found Hartman, Steven via Tech-talk
References:
Python Script call from Button press, module not found Manoussakis, Adamandios via Tech-talk
Re: Python Script call from Button press, module not found Kasemir, Kay via Tech-talk
RE: Python Script call from Button press, module not found Manoussakis, Adamandios via Tech-talk
Re: Python Script call from Button press, module not found Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: Re: Python Script call from Button press, module not found Matt Newville via Tech-talk
Next: Re: Python Script call from Button press, module not found Manoussakis, Adamandios via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: Python Script call from Button press, module not found Kasemir, Kay via Tech-talk
Next: Re: Python Script call from Button press, module not found Manoussakis, Adamandios via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 15 Apr 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·