大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
1.json文件保存
将数据保存为json格式,并存储到.json文件中,需要注意键值对均用双引号,而非单引号。
样例如下所示:
{
"sampleDB": {
"shippedVsCustDemand": [{
"CUSTOMER": "customer1", "ITEM": "desk", "SUPPLIEDQTY": 25, "DEMANDQTY": 3}, {
"CUSTOMER": "customer1", "ITEM": "drawer", "SUPPLIEDQTY": 15, "DEMANDQTY": 12}, {
"CUSTOMER": "customer1", "ITEM": "table", "SUPPLIEDQTY": 52, "DEMANDQTY": 6}, {
"CUSTOMER": "customer2", "ITEM": "end table", "SUPPLIEDQTY": null, "DEMANDQTY": 5}, {
"CUSTOMER": "customer2", "ITEM": "leg", "SUPPLIEDQTY": null, "DEMANDQTY": 10}, {
"CUSTOMER": "customer2", "ITEM": "round table", "SUPPLIEDQTY": null, "DEMANDQTY": 15}, {
"CUSTOMER": "customer3", "ITEM": "desk", "SUPPLIEDQTY": null, "DEMANDQTY": 21}, {
"CUSTOMER": "customer3", "ITEM": "desk top", "SUPPLIEDQTY": null, "DEMANDQTY": 14}, {
"CUSTOMER": "customer3", "ITEM": "end table", "SUPPLIEDQTY": 1, "DEMANDQTY": 7}], "totalManufItems": [{
"ITEM": "desk", "TOTALMANUFQTY": 25}, {
"ITEM": "end table", "TOTALMANUFQTY": 155}]}}
2.组合键
在pycharm中,使用组合键ctrl+alt+L进行格式化。
效果如下所示:
{
"sampleDB": {
"shippedVsCustDemand": [{
"CUSTOMER": "customer1", "ITEM": "desk", "SUPPLIEDQTY": 25, "DEMANDQTY": 3},
{
"CUSTOMER": "customer1", "ITEM": "drawer", "SUPPLIEDQTY": 15, "DEMANDQTY": 12},
{
"CUSTOMER": "customer1", "ITEM": "table", "SUPPLIEDQTY": 52, "DEMANDQTY": 6},
{
"CUSTOMER": "customer2", "ITEM": "end table", "SUPPLIEDQTY": null,
"DEMANDQTY": 5},
{
"CUSTOMER": "customer2", "ITEM": "leg", "SUPPLIEDQTY": null, "DEMANDQTY": 10},
{
"CUSTOMER": "customer2", "ITEM": "round table", "SUPPLIEDQTY": null,
"DEMANDQTY": 15},
{
"CUSTOMER": "customer3", "ITEM": "desk", "SUPPLIEDQTY": null, "DEMANDQTY": 21},
{
"CUSTOMER": "customer3", "ITEM": "desk top", "SUPPLIEDQTY": null,
"DEMANDQTY": 14},
{
"CUSTOMER": "customer3", "ITEM": "end table", "SUPPLIEDQTY": 1, "DEMANDQTY": 7}],
"totalManufItems": [{
"ITEM": "desk", "TOTALMANUFQTY": 25}, {
"ITEM": "end table", "TOTALMANUFQTY": 155}]}}
参考:
[1] https://www.it610.com/article/1295759947937685504.htm
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/173195.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...