This article provides a code sample of how to import Spotfire® libraries and extensions from a local directory using IronPython in Spotfire®
Introduction
If you need to use code that has been already deployed inside an extension in your Spotfire script, this is useful trick. This also allows us to create custom libraries with code that can utilized in our IronPython scripts. We can use this method to import all DLL files from a desired location.
See also: Execute a custom tool on how to invoke a extension/tool after it is imported.
Code sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. # Get the path of an extension if the internal name is known import sys from System.IO import Directory, Path directory = Directory.GetCurrentDirectory() importDirectory = Path.GetDirectoryName(directory) # The name of the extension in the Modules folder. name = '\\TIBCO SDK Custom Tools_' # Current version of the extension seen in the Modules folder. version = '1.0.0.0' sys.path.append(importDirectory + name + version)
References
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.