gpt4 book ai didi

python - 如何将 VBA 输出发送到 Python 脚本?

转载 作者:太空宇宙 更新时间:2023-11-03 15:11:03 26 4
gpt4 key购买 nike

这是一个代码片段:

' Send the query in the body to Jira, and get the response from Jira

strJsonResponse = Utilities.JiraRequest(strJQLQuery)

我想将此 json 放入 Python 解析器中,然后将解析后的 json 返回到电子表格中。这可能吗?我以前从未使用过 VBA。

我已经下载了 JIRA API 模块和 openpyxl 模块。

最佳答案

您也许可以创建一个新的文本文件并向其中输出 VBA

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\your_path\vba.txt", True, True)
Fileout.Write strJsonResponse
Fileout.Close

VBA code found here

然后让 VBA 启动您的 python 脚本,您可以在其中让 python 解析您的文件。可能有更好的方法来做到这一点,但我不确定是什么。

关于python - 如何将 VBA 输出发送到 Python 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44208870/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com