Manoj Chaurasia Posted September 18, 2014 Share Posted September 18, 2014 Hi, How can I call a ironpython script from another script, if someone can provide an example that would be best Link to comment Share on other sites More sharing options...
Norbert Ledenyi Posted October 23, 2015 Share Posted October 23, 2015 Hi. This is how call an another script without parameters: from Spotfire.Dxp.Application.Scripting import ScriptDefinition from System.Collections.Generic import Dictionary import clr scriptDef = clr.Reference[scriptDefinition]() Document.ScriptManager.TryGetScript("otherScript", scriptDef) params = Dictionary[str, object]() Document.ScriptManager.ExecuteScript(scriptDef.ScriptCode, params) Link to comment Share on other sites More sharing options...
Swapnil Jadhav Posted October 17, 2016 Share Posted October 17, 2016 Thanks Norbert for providing the code! It works fine. Link to comment Share on other sites More sharing options...
Charitha Amaraneni Posted October 2, 2019 Share Posted October 2, 2019 Hi, Will this work if my calledscript (2nd script) has a API call in it It doesn't look like the API call is being made. Can anyone help me with this Thanks. Link to comment Share on other sites More sharing options...
Paul Shumaker Posted October 2, 2019 Share Posted October 2, 2019 Can you give more details about what you're asking The script that's being executed by this one is in a different context I think and any API calls within it shouldn't need an additional API call in this script. At least that's how it seemed to work for me when I implemented it Link to comment Share on other sites More sharing options...
Charitha Amaraneni Posted October 2, 2019 Share Posted October 2, 2019 Hi P.shu, My Script "A" has an API call using OAUTH to load the Data. that API call is not being made when i load the Spotfire dxp file(created datafunction to trigger script when the doc property changes) or call this script A from another script (using above code). Did this help you in understanding what i was trying to do Thanks Link to comment Share on other sites More sharing options...
Paul Shumaker Posted October 7, 2019 Share Posted October 7, 2019 If you run the script inside the edit window what comes up Also if not using 2.7.7 there may be limitations to the classes you can use Link to comment Share on other sites More sharing options...
Charitha Amaraneni Posted October 7, 2019 Share Posted October 7, 2019 If i run the script inside Edit Window, the API call is being made and Latest Data Loads. but I dont want to manually execute the Script all the time. I want the Script to get executed automatically, or through some button. I tried multiple ways, it looks like the latest data is not loaded until and unless i manually execute the script. Link to comment Share on other sites More sharing options...
Charitha Amaraneni Posted October 18, 2019 Share Posted October 18, 2019 If i run the Script insside Window, i get the desired Data ( its not happening when i run it through Script). im using ironPython V2.7.7. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now