Jump to content

Spotfire doesn't recognize changes in external IronPython scripts


Cody Mayers

Recommended Posts

I have an IronPython script saved externally, which I import and use within Spotfire like in this article:

https://community.spotfire.com/wiki/how-import-external-python-module-using-ironpython-script-tibco-spotfirer-without-deploying

However, when I make a change to the external script and then try to run it via Spotfire, the changes I just made are not reflected. It's as if Spotfire is caching the old version of the script and continuing to run the cached version instead.

I only see this issue when I'm trying to interact with a Spotfire control (e.g. a button) which is configured to run an IronPython script embedded within Spotfire, which in turn imports the external script and runs it. Interestingly, if I instead manually open and run the embedded script, it imports the newly-updated external script and works as expected.

Link to comment
Share on other sites

This is the expected behavior. When executing an IronPython script the "execution" is cached using the script code as cache key. This means that when executing the same code again, the previous "execution" environment will be used. This is why the module definiton is not re-read from disk.

Changing/executing the IronPython script code in script editor will thus cause the module to be read again. Executing from within the script edit dialog does not use the cache mechanism.

As a workaround, you will need to manually run/execute the script once from the script editor to update any changes done to external python module.

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...