• python json 格式化 打印


    import json
    
    data = {
      "rmK12Uau.ntP510KeImX506H6Mr6jTu": {
        "title": "Slow Cooker Chicken and Dumplings",
        "ingredients": [
          "4 skinless, boneless chicken breast halves ADVERTISEMENT",
          "2 tablespoons butter ADVERTISEMENT",
          "2 (10.75 ounce) cans condensed cream of chicken soup ADVERTISEMENT",
          "1 onion, finely diced ADVERTISEMENT",
          "2 (10 ounce) packages refrigerated biscuit dough, torn into pieces ADVERTISEMENT",
          "ADVERTISEMENT"
        ],
        "instructions": "Place the chicken, butter, soup, and onion in a slow cooker, and fill with enough water to cover.\nCover, and cook for 5 to 6 hours on High. About 30 minutes before serving, place the torn biscuit dough in the slow cooker. Cook until the dough is no longer raw in the center.\n",
        "picture_link": "55lznCYBbs2mT8BTx6BTkLhynGHzM.S"
      },
      "5ZpZE8hSVdPk2ZXo1mZTyoPWJRSCPSm": {
        "title": "Awesome Slow Cooker Pot Roast",
        "ingredients": [
          "2 (10.75 ounce) cans condensed cream of mushroom soup ADVERTISEMENT",
          "1 (1 ounce) package dry onion soup mix ADVERTISEMENT",
          "1 1/4 cups water ADVERTISEMENT",
          "5 1/2 pounds pot roast ADVERTISEMENT",
          "ADVERTISEMENT"
        ],
        "instructions": "In a slow cooker, mix cream of mushroom soup, dry onion soup mix and water. Place pot roast in slow cooker and coat with soup mixture.\nCook on High setting for 3 to 4 hours, or on Low setting for 8 to 9 hours.\n",
        "picture_link": "QyrvGdGNMBA2lDdciY0FjKu.77MM0Oe"
      }
    }
    
    
    print(json.dumps(data, ensure_ascii=False, indent=4, separators=(',', ':')))

  • 相关阅读:
    安装oh-my-zsh失败,可按以下方式安装
    aria2 for mac
    java抛出异常后,后续代码是否可继续执行
    mac多线程下载神器
    Oracle--大数据迁移--sqlldr技术的应用
    Windows版 GCC编译器安装和使用--MinGW
    Visual Studio 2015 安装与注册
    android studio 3.6 环境搭建(安装步骤)
    IDEA--主题样式设置
    数据--innercode--的处理
  • 原文地址:https://www.cnblogs.com/cupleo/p/16571257.html
Copyright © 2020-2023  润新知