Date Posted:
Product: TIBCO Spotfire®
Product: TIBCO Spotfire®
Problem:
IronPython.Runtime.Exceptions.ImportException: No module named os.path
Solution:
Trying to import the os.path Python module in Spotfire fails with the error -IronPython.Runtime.Exceptions.ImportException: No module named os.path
The OS module is not seem a part of the Spotfire Python module so it fails to load and cannot be used in the Spotfire Python scripts.
The .NET module System.IO can be used for any file related operations. For example, to check if a file exists in a directory, use the following snippet:
from System.IO import File
path = r'c:\temp\myfile.txt'
print 'File Exists: %s' % File.Exists(path)
https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx
Comments
0 comments
Article is closed for comments.