Jump to content

How to trigger python script from spotfire. (Output displayed on Spotfire output console)


Hung Huynh

Recommended Posts

Edit: Solution Found

I have a Python script that uses libraries unavailable in IronPython. I would like to trigger the python script from Spotfire and display the output on Spotfire's output console.

from System.Diagnostics import Process

from System.Diagnostics import ProcessStartInfo

from System.Diagnostics import ProcessWindowStyle

 

process = Process()

startInfo = ProcessStartInfo()

startInfo.WindowStyle = ProcessWindowStyle.Hidden

startInfo.FileName = "C:Anaconda3python.exe"

startInfo.Arguments = "C:Anaconda3BubbleSort.py"

process.StartInfo = startInfo

startInfo.CreateNoWindow = False

startInfo.UseShellExecute = False

process.Start()

Link to comment
Share on other sites

Hi,

 

There is a free Spotfire extension so you can add Python code into Spotfire as data functions, meaning you can run any Python code and return outputs to Spotfire directly. As long as you have installed libraries in your Python install (using pip for example), you can use them in these data functions also. This avoids the need to call an executable. You can find out about it here and download the extension:

 

https://community.spotfire.com/wiki/python-data-function-tibco-spotfire

 

Hope this helps,

 

Thanks

Colin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...