def testFileStream(): print 'Verifying FileStream against MemoryStream' stopwatch = Stopwatch.StartNew() for i in xrange(128): m = MemoryStream() file = Path.GetTempFileName() f = FileStream(file, FileMode.Open) try: streams = [m, f] randomOperations(128, streams) finally: f.Close() File.Delete(file) stopwatch.Stop() print '%s' % stopwatch.Elapsed
from System.IO import Path, File, StreamWriter from Spotfire.Dxp.Application.Visuals import TablePlot #Temp file for storing the table data tempFolder = Path.GetTempPath() tempFilename = Path.GetTempFileName() #Export table data to the temp file writer = StreamWriter(tempFilename) vTable.As[TablePlot]().ExportText(writer) print tempFilename