python中通过用户输入将数据获取到json骨架中
假设我有一个像这样的输入框架,
"thing": {
"name": "",
"date": ""
},
"anotherThing": [
{
"name": "",
"description": "",
"expirationDate": ""
}
],
我将如何通过用户输入填充空白,以便它看起来像这样?
"thing": {
"name": "Water",
"date": "07/27/2022"
},
"anotherThing": [
{
"name": "Fire",
"description": "is hot",
"expirationDate": "05/22/2026"
}
],
或者类似上面的内容取决于用户输入的内容?
Say I have an input skeleton like this
"thing": {
"name": "",
"date": ""
},
"anotherThing": [
{
"name": "",
"description": "",
"expirationDate": ""
}
],
How would I go about filling in the blanks through user inputs so it could look something like this?
"thing": {
"name": "Water",
"date": "07/27/2022"
},
"anotherThing": [
{
"name": "Fire",
"description": "is hot",
"expirationDate": "05/22/2026"
}
],
or something like that above depending on what the user inputs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 JSON 写入文件
you would need to write the JSON as a file