Jump to content
  • How to import an external Python module using IronPython Script into Spotfire® without deploying to the Spotfire® server.


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

    Introduction

    This article describes about how to import an external Python module using IronPython Script into Spotfire® without deploying to the 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

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...