How to import an external Python module using IronPython Script into TIBCO Spotfire® without deploying to the TIBCO Spotfire® server.
By:
Last updated:
1:37am Jan 17, 2019

Back to main IronPython scripting page

Introduction

This article describes about how to import an external Python module using IronPython Script into TIBCO Spotfire® without deploying to the TIBCO Spotfire® server.

  1.  Create a folder named MyPythonModule.
  2.  Create a sample file "mymodule.py" in the above folder.

Python Module

# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.

# Python Module name "mymodule.py" to import into Spotfire.


def hello(string):
	#return "Hello %s!" % (string,)
	print ('Hello ' + string )

 

IronPython Script

# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.

#IronPython Script to import an external Python module "mymodule.py" into Spotfire.

import sys
sys.path.append(r'D:\MyPythonModule')
from mymodule import hello

x= hello("world");

 

License:  TIBCO BSD-Style License