当我运行功能时,为什么我的JSON文件弹出窗口不在工作目录中?
这个想法是在下面的function
函数中使用配置的输入在下面的工作目录中创建一个JSON文件。但是,该文件不是在工作目录中使用标签w
创建的。关于为什么不这样做的任何想法吗?如果没有解决方案,该替代方案是什么?
def funct(var):
varTwo= {
"varThree":[
{
}
]
}
with open("temp.json", "w") as f:
json.dump(varTwo, f, indent=4)
The idea is for a JSON file to be created in the working directory with configured inputs in the funct
function below. But the file is not created in the working directory with tag w
. Any Idea as to why its not doing so? what is an alternative to this if there is no solution?
def funct(var):
varTwo= {
"varThree":[
{
}
]
}
with open("temp.json", "w") as f:
json.dump(varTwo, f, indent=4)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论