将Spotfire的“打印"输出到文本文件

编程入门 行业动态 更新时间:2024-10-11 15:23:48
本文介绍了将Spotfire的“打印"输出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在努力寻求一个简单的问题.我想将Spotfire的值(字符串/实数/字符串列表)输出到计算机上的文本文件中.我的最终解决方案将需要列出和保存文档属性,但现在让我们使用来自stackoverflow的有效脚本:是否可以使用IronPython将当前* .dxp项目的路径作为字符串返回?

I have been struggling with something I hope to be a simple question. I would like to output values (String / Real / Stringlist) from Spotfire to a text file on my computer. My final solution would need document properties to be listed and saved, but for now let's use a working script from stackoverflow: Is it possible to use IronPython to return the path of the current *.dxp project as a string?

两个变量:路径"和分析"被打印".如何将它们打印到文本文件?

Two variables: path and analysis are 'printed'. How can I print those to a text file?

类似的操作在这里完成: spotfired.blogspot.co.uk/2014/04/export-image-from-visualization.html ,其中将创建.bmp图像.

Something similar is done here: spotfired.blogspot.co.uk/2014/04/export-image-from-visualization.html where a .bmp image is created.

非常感谢,

推荐答案

写入文件不是IronPython独有的. Python文档对此进行了很好的介绍.无论如何:

writing to a file isn't unique to IronPython; the Python docs go over this fairly well. in any case:

f = open('c:\\filename.txt', 'w') f.write(path) f.write(analysis) my_list = ['one','two','three'] for item in my_list: f.write(item) # write the item's content f.write('\n') # add a line break (optional) f.close()

你会没事的.

IronPython是常规Python的派生产品,可以与.NET API(例如Spotfire的API)进行交互.因此,通常您可以通过查看Python资源找到非Spotfire专用的解决方案.

IronPython is a derivative of regular Python that can interact with .NET APIs such as Spotfire's API. thus, you can typically find non-Spotfire-specific solutions by looking at Python resources.

更多推荐

将Spotfire的“打印"输出到文本文件

本文发布于:2023-11-24 05:58:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624171.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件   Spotfire   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!