python - Ironpython Spotfire / 导出到 html 文件
问题描述
我已经看到了通过 ironpython 导出到 excel 或 pdf 的方法,但我真正需要的是使用 ironpython 脚本创建一个 html 文件。
现在我正在使用这行代码,但我能够创建文档。
with open("C:\\Users\\output\\testfile.html","w") as file:
file.write(htmlReport)
解决方案
我尝试了这段代码,它似乎可以工作并创建 html 文件-
htmlReport="""<html>
<body><table border=1>
<tr><td>1</td><td>AAA</td></tr><tr><td>2</td><td>BBB</td></tr><tr><td>3</td><td>CCC</td></tr></table></body></html>"""
with open("C:\\temp\\testfile.html","w") as file:
file.write(htmlReport)
推荐阅读
- javascript - 无法在js中设置未定义的属性'boxShadow' - 样式
- reactjs - React TypeError:无法读取未定义的属性“推送”
- java - 线程“主”java.lang.ArrayIndexOutOfBoundsException 中的异常:索引 1 超出长度 0 的范围
- list - 如何在共享点列表中向用户授予查看级别权限
- javascript - 钛合金页脚导航栏导航
- dart - 异步未来,如何将已获取单个项目的事件发送回调用者?
- ios - 如何快速检查 wifi 上的受限访问,例如我的设备已连接到 wifi 但该 wifi 没有互联网连接
- node.js - Docker 无法从 package.json 文件安装依赖项
- javascript - .html() 不显示字段
- spring - 安装在 docker 容器内的 mongo db 超时异常