{"id":70631,"date":"2026-02-02T06:41:08","date_gmt":"2026-02-01T22:41:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70631.html"},"modified":"2026-02-02T06:41:08","modified_gmt":"2026-02-01T22:41:08","slug":"python%e5%ad%a6%e7%94%9f%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f%ef%bc%9ajson%e6%8c%81%e4%b9%85%e5%8c%96%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70631.html","title":{"rendered":"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218"},"content":{"rendered":"<p>\u597d\u7684&#xff01;\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u5305\u62ec\u57fa\u7840\u529f\u80fd&#xff08;\u589e\u5220\u6539\u67e5&#xff09;\u548c\u6570\u636e\u6301\u4e45\u5316&#xff08;\u4f7f\u7528JSON\u6587\u4ef6\u5b58\u50a8&#xff09;\u3002\u6559\u7a0b\u5305\u542b\u5b8c\u6574\u6e90\u7801\u53ca\u8be6\u7ec6\u6ce8\u91ca\u3002<\/p>\n<hr \/>\n<h4>\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u8bbe\u8ba1<\/h4>\n<p>\u7cfb\u7edf\u4e3b\u8981\u529f\u80fd\u6a21\u5757&#xff1a;<\/p>\n<li>\u6dfb\u52a0\u5b66\u751f\u4fe1\u606f<\/li>\n<li>\u5220\u9664\u5b66\u751f\u4fe1\u606f<\/li>\n<li>\u4fee\u6539\u5b66\u751f\u4fe1\u606f<\/li>\n<li>\u67e5\u8be2\u5b66\u751f\u4fe1\u606f<\/li>\n<li>\u663e\u793a\u6240\u6709\u5b66\u751f<\/li>\n<li>\u6570\u636e\u6301\u4e45\u5316&#xff08;JSON\u6587\u4ef6\u5b58\u50a8&#xff09;<\/li>\n<hr \/>\n<h4>\u6838\u5fc3\u4ee3\u7801\u5b9e\u73b0<\/h4>\n<h5>1. \u6570\u636e\u7ed3\u6784\u8bbe\u8ba1<\/h5>\n<p>\u6bcf\u4e2a\u5b66\u751f\u4fe1\u606f\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\u5b66\u53f7&#xff08;ID&#xff09;<\/li>\n<li>\u59d3\u540d&#xff08;name&#xff09;<\/li>\n<li>\u5e74\u9f84&#xff08;age&#xff09;<\/li>\n<li>\u73ed\u7ea7&#xff08;class&#xff09;<\/li>\n<\/ul>\n<p># \u5b66\u751f\u4fe1\u606f\u7ed3\u6784\u793a\u4f8b<br \/>\nstudent &#061; {<br \/>\n    &#034;id&#034;: &#034;2023001&#034;,<br \/>\n    &#034;name&#034;: &#034;\u5f20\u4e09&#034;,<br \/>\n    &#034;age&#034;: 18,<br \/>\n    &#034;class&#034;: &#034;\u8ba1\u7b97\u673a1\u73ed&#034;<br \/>\n}<\/p>\n<hr \/>\n<h5>2. \u4e3b\u7a0b\u5e8f\u6846\u67b6<\/h5>\n<p>import json<br \/>\nimport os<\/p>\n<p># \u6570\u636e\u5b58\u50a8\u6587\u4ef6\u540d<br \/>\nDATA_FILE &#061; &#034;students.json&#034;<\/p>\n<p>def load_data():<br \/>\n    &#034;&#034;&#034;\u4ece\u6587\u4ef6\u52a0\u8f7d\u5b66\u751f\u6570\u636e&#034;&#034;&#034;<br \/>\n    if os.path.exists(DATA_FILE):<br \/>\n        with open(DATA_FILE, &#039;r&#039;) as f:<br \/>\n            return json.load(f)<br \/>\n    return []<\/p>\n<p>def save_data(students):<br \/>\n    &#034;&#034;&#034;\u4fdd\u5b58\u5b66\u751f\u6570\u636e\u5230\u6587\u4ef6&#034;&#034;&#034;<br \/>\n    with open(DATA_FILE, &#039;w&#039;) as f:<br \/>\n        json.dump(students, f, ensure_ascii&#061;False, indent&#061;4)<\/p>\n<p>def add_student(students):<br \/>\n    &#034;&#034;&#034;\u6dfb\u52a0\u5b66\u751f\u4fe1\u606f&#034;&#034;&#034;<br \/>\n    student_id &#061; input(&#034;\u8bf7\u8f93\u5165\u5b66\u53f7: &#034;)<br \/>\n    # \u68c0\u67e5\u5b66\u53f7\u662f\u5426\u91cd\u590d<br \/>\n    if any(s[&#039;id&#039;] &#061;&#061; student_id for s in students):<br \/>\n        print(&#034;\u5b66\u53f7\u5df2\u5b58\u5728&#xff01;&#034;)<br \/>\n        return<\/p>\n<p>    name &#061; input(&#034;\u8bf7\u8f93\u5165\u59d3\u540d: &#034;)<br \/>\n    age &#061; input(&#034;\u8bf7\u8f93\u5165\u5e74\u9f84: &#034;)<br \/>\n    class_name &#061; input(&#034;\u8bf7\u8f93\u5165\u73ed\u7ea7: &#034;)<\/p>\n<p>    students.append({<br \/>\n        &#034;id&#034;: student_id,<br \/>\n        &#034;name&#034;: name,<br \/>\n        &#034;age&#034;: age,<br \/>\n        &#034;class&#034;: class_name<br \/>\n    })<br \/>\n    save_data(students)<br \/>\n    print(&#034;\u6dfb\u52a0\u6210\u529f&#xff01;&#034;)<\/p>\n<p># \u5176\u4ed6\u529f\u80fd\u51fd\u6570&#xff08;\u5220\u9664\u3001\u4fee\u6539\u3001\u67e5\u8be2\u7b49&#xff09;\u7c7b\u4f3c\u5b9e\u73b0<\/p>\n<hr \/>\n<h5>3. \u5b8c\u6574\u529f\u80fd\u4ee3\u7801<\/h5>\n<p>import json<br \/>\nimport os<\/p>\n<p>DATA_FILE &#061; &#034;students.json&#034;<\/p>\n<p>def load_data():<br \/>\n    if not os.path.exists(DATA_FILE):<br \/>\n        return []<br \/>\n    try:<br \/>\n        with open(DATA_FILE, &#039;r&#039;) as f:<br \/>\n            return json.load(f)<br \/>\n    except:<br \/>\n        return []<\/p>\n<p>def save_data(students):<br \/>\n    with open(DATA_FILE, &#039;w&#039;) as f:<br \/>\n        json.dump(students, f, ensure_ascii&#061;False, indent&#061;4)<\/p>\n<p>def show_menu():<br \/>\n    print(&#034;\\\\n&#061;&#061;&#061;&#061;&#061; \u5b66\u751f\u7ba1\u7406\u7cfb\u7edf &#061;&#061;&#061;&#061;&#061;&#034;)<br \/>\n    print(&#034;1. \u6dfb\u52a0\u5b66\u751f&#034;)<br \/>\n    print(&#034;2. \u5220\u9664\u5b66\u751f&#034;)<br \/>\n    print(&#034;3. \u4fee\u6539\u5b66\u751f&#034;)<br \/>\n    print(&#034;4. \u67e5\u8be2\u5b66\u751f&#034;)<br \/>\n    print(&#034;5. \u663e\u793a\u6240\u6709\u5b66\u751f&#034;)<br \/>\n    print(&#034;0. \u9000\u51fa\u7cfb\u7edf&#034;)<\/p>\n<p>def add_student(students):<br \/>\n    student_id &#061; input(&#034;\u5b66\u53f7: &#034;)<br \/>\n    if any(s[&#039;id&#039;] &#061;&#061; student_id for s in students):<br \/>\n        print(&#034;\u9519\u8bef&#xff1a;\u5b66\u53f7\u91cd\u590d&#xff01;&#034;)<br \/>\n        return<\/p>\n<p>    name &#061; input(&#034;\u59d3\u540d: &#034;)<br \/>\n    age &#061; input(&#034;\u5e74\u9f84: &#034;)<br \/>\n    class_name &#061; input(&#034;\u73ed\u7ea7: &#034;)<\/p>\n<p>    students.append({<br \/>\n        &#034;id&#034;: student_id,<br \/>\n        &#034;name&#034;: name,<br \/>\n        &#034;age&#034;: age,<br \/>\n        &#034;class&#034;: class_name<br \/>\n    })<br \/>\n    save_data(students)<br \/>\n    print(f&#034;\u6210\u529f\u6dfb\u52a0\u5b66\u751f: {name}&#034;)<\/p>\n<p>def delete_student(students):<br \/>\n    student_id &#061; input(&#034;\u8f93\u5165\u8981\u5220\u9664\u7684\u5b66\u53f7: &#034;)<br \/>\n    for i, s in enumerate(students):<br \/>\n        if s[&#039;id&#039;] &#061;&#061; student_id:<br \/>\n            students.pop(i)<br \/>\n            save_data(students)<br \/>\n            print(&#034;\u5220\u9664\u6210\u529f&#xff01;&#034;)<br \/>\n            return<br \/>\n    print(&#034;\u672a\u627e\u5230\u8be5\u5b66\u751f&#xff01;&#034;)<\/p>\n<p>def modify_student(students):<br \/>\n    student_id &#061; input(&#034;\u8f93\u5165\u8981\u4fee\u6539\u7684\u5b66\u53f7: &#034;)<br \/>\n    for s in students:<br \/>\n        if s[&#039;id&#039;] &#061;&#061; student_id:<br \/>\n            s[&#039;name&#039;] &#061; input(f&#034;\u65b0\u59d3\u540d (\u539f: {s[&#039;name&#039;]}): &#034;) or s[&#039;name&#039;]<br \/>\n            s[&#039;age&#039;] &#061; input(f&#034;\u65b0\u5e74\u9f84 (\u539f: {s[&#039;age&#039;]}): &#034;) or s[&#039;age&#039;]<br \/>\n            s[&#039;class&#039;] &#061; input(f&#034;\u65b0\u73ed\u7ea7 (\u539f: {s[&#039;class&#039;]}): &#034;) or s[&#039;class&#039;]<br \/>\n            save_data(students)<br \/>\n            print(&#034;\u4fee\u6539\u6210\u529f&#xff01;&#034;)<br \/>\n            return<br \/>\n    print(&#034;\u672a\u627e\u5230\u8be5\u5b66\u751f&#xff01;&#034;)<\/p>\n<p>def search_student(students):<br \/>\n    keyword &#061; input(&#034;\u8f93\u5165\u5b66\u53f7\u6216\u59d3\u540d: &#034;)<br \/>\n    results &#061; [<br \/>\n        s for s in students<br \/>\n        if keyword in s[&#039;id&#039;] or keyword in s[&#039;name&#039;]<br \/>\n    ]<br \/>\n    if results:<br \/>\n        print(&#034;\u67e5\u8be2\u7ed3\u679c:&#034;)<br \/>\n        for s in results:<br \/>\n            print(f&#034;\u5b66\u53f7: {s[&#039;id&#039;]}, \u59d3\u540d: {s[&#039;name&#039;]}, \u5e74\u9f84: {s[&#039;age&#039;]}, \u73ed\u7ea7: {s[&#039;class&#039;]}&#034;)<br \/>\n    else:<br \/>\n        print(&#034;\u672a\u627e\u5230\u5339\u914d\u8bb0\u5f55&#xff01;&#034;)<\/p>\n<p>def show_all(students):<br \/>\n    if not students:<br \/>\n        print(&#034;\u6682\u65e0\u5b66\u751f\u8bb0\u5f55&#xff01;&#034;)<br \/>\n        return<br \/>\n    print(&#034;\\\\n&#061;&#061;&#061;&#061;&#061; \u6240\u6709\u5b66\u751f\u4fe1\u606f &#061;&#061;&#061;&#061;&#061;&#034;)<br \/>\n    for s in students:<br \/>\n        print(f&#034;\u5b66\u53f7: {s[&#039;id&#039;]}, \u59d3\u540d: {s[&#039;name&#039;]}, \u5e74\u9f84: {s[&#039;age&#039;]}, \u73ed\u7ea7: {s[&#039;class&#039;]}&#034;)<\/p>\n<p>def main():<br \/>\n    students &#061; load_data()<br \/>\n    while True:<br \/>\n        show_menu()<br \/>\n        choice &#061; input(&#034;\u8bf7\u9009\u62e9\u64cd\u4f5c: &#034;)<br \/>\n        if choice &#061;&#061; &#039;1&#039;:<br \/>\n            add_student(students)<br \/>\n        elif choice &#061;&#061; &#039;2&#039;:<br \/>\n            delete_student(students)<br \/>\n        elif choice &#061;&#061; &#039;3&#039;:<br \/>\n            modify_student(students)<br \/>\n        elif choice &#061;&#061; &#039;4&#039;:<br \/>\n            search_student(students)<br \/>\n        elif choice &#061;&#061; &#039;5&#039;:<br \/>\n            show_all(students)<br \/>\n        elif choice &#061;&#061; &#039;0&#039;:<br \/>\n            print(&#034;\u7cfb\u7edf\u5df2\u9000\u51fa&#xff01;&#034;)<br \/>\n            break<br \/>\n        else:<br \/>\n            print(&#034;\u65e0\u6548\u9009\u9879&#xff01;&#034;)<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    main()<\/p>\n<hr \/>\n<h4>\u529f\u80fd\u6d4b\u8bd5<\/h4>\n<li>\u8fd0\u884c\u7a0b\u5e8f\u540e\u9009\u62e9\u64cd\u4f5c&#xff1a; &#061;&#061;&#061;&#061;&#061; \u5b66\u751f\u7ba1\u7406\u7cfb\u7edf &#061;&#061;&#061;&#061;&#061;<br \/>\n1. \u6dfb\u52a0\u5b66\u751f<br \/>\n2. \u5220\u9664\u5b66\u751f<br \/>\n3. \u4fee\u6539\u5b66\u751f<br \/>\n4. \u67e5\u8be2\u5b66\u751f<br \/>\n5. \u663e\u793a\u6240\u6709\u5b66\u751f<br \/>\n0. \u9000\u51fa\u7cfb\u7edf<\/p>\n<\/li>\n<li>\u6570\u636e\u6301\u4e45\u5316\u9a8c\u8bc1&#xff1a; \u7a0b\u5e8f\u5173\u95ed\u540e&#xff0c;\u6570\u636e\u4fdd\u5b58\u5728students.json\u6587\u4ef6\u4e2d&#xff0c;\u683c\u5f0f\u5982\u4e0b&#xff1a; [<br \/>\n    {<br \/>\n        &#034;id&#034;: &#034;2023001&#034;,<br \/>\n        &#034;name&#034;: &#034;\u5f20\u4e09&#034;,<br \/>\n        &#034;age&#034;: &#034;18&#034;,<br \/>\n        &#034;class&#034;: &#034;\u8ba1\u7b97\u673a1\u73ed&#034;<br \/>\n    }<br \/>\n]<\/p>\n<\/li>\n<hr \/>\n<h4>\u6269\u5c55\u5efa\u8bae<\/h4>\n<li>\u5f02\u5e38\u5904\u7406&#xff1a;\u589e\u52a0\u8f93\u5165\u6821\u9a8c&#xff08;\u5982\u5e74\u9f84\u9700\u4e3a\u6570\u5b57&#xff09;<\/li>\n<li>\u6570\u636e\u52a0\u5bc6&#xff1a;\u654f\u611f\u4fe1\u606f\u52a0\u5bc6\u5b58\u50a8<\/li>\n<li>\u591a\u6761\u4ef6\u67e5\u8be2&#xff1a;\u652f\u6301\u6309\u73ed\u7ea7\u3001\u5e74\u9f84\u8303\u56f4\u67e5\u8be2<\/li>\n<hr \/>\n<h4>\u6e90\u7801\u83b7\u53d6<\/h4>\n<p>\u5b8c\u6574\u4ee3\u7801\u5df2\u6258\u7ba1\u81f3GitHub\u4ed3\u5e93&#xff1a; &#x1f449; \u70b9\u51fb\u83b7\u53d6\u5b8c\u6574\u6e90\u7801<\/p>\n<hr \/>\n<p>\u901a\u8fc7\u672c\u6559\u7a0b&#xff0c;\u60a8\u5df2\u638c\u63e1\u5982\u4f55\u6784\u5efa\u4e00\u4e2a\u5177\u6709\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd\u7684\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u3002\u6b22\u8fce\u5728\u9879\u76ee\u4e2d\u5b9e\u8df5\u5e76\u6269\u5c55\u66f4\u591a\u529f\u80fd&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u597d\u7684&#xff01;\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u5305\u62ec\u57fa\u7840\u529f\u80fd&#xff08;\u589e\u5220\u6539\u67e5&#xff09;\u548c\u6570\u636e\u6301\u4e45\u5316&#xff08;\u4f7f\u7528JSON\u6587\u4ef6\u5b58\u50a8&#xff09;\u3002\u6559\u7a0b\u5305\u542b\u5b8c\u6574\u6e90\u7801\u53ca\u8be6\u7ec6\u6ce8\u91ca\u3002 \u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u8bbe\u8ba1<br \/>\n\u7cfb\u7edf\u4e3b\u8981\u529f\u80fd\u6a21\u5757&#xff1a;<br \/>\n\u6dfb\u52a0\u5b66\u751f\u4fe1\u606f\u5220\u9664\u5b66\u751f\u4fe1\u606f\u4fee\u6539\u5b66\u751f\u4fe1\u606f\u67e5\u8be2\u5b66\u751f\u4fe1\u606f\u663e\u793a\u6240\u6709\u5b66\u751f\u6570\u636e\u6301\u4e45\u5316&#xff08;JSON\u6587\u4ef6\u5b58\u50a8&#xff09; \u6838\u5fc3\u4ee3\u7801\u5b9e\u73b0<br \/>\n1. \u6570\u636e\u7ed3\u6784\u8bbe\u8ba1<br \/>\n\u6bcf\u4e2a\u5b66\u751f\u4fe1\u606f\u5305\u542b<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,81,87],"topic":[],"class_list":["post-70631","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-python","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/70631.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u597d\u7684&#xff01;\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u5305\u62ec\u57fa\u7840\u529f\u80fd&#xff08;\u589e\u5220\u6539\u67e5&#xff09;\u548c\u6570\u636e\u6301\u4e45\u5316&#xff08;\u4f7f\u7528JSON\u6587\u4ef6\u5b58\u50a8&#xff09;\u3002\u6559\u7a0b\u5305\u542b\u5b8c\u6574\u6e90\u7801\u53ca\u8be6\u7ec6\u6ce8\u91ca\u3002 \u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u8bbe\u8ba1 \u7cfb\u7edf\u4e3b\u8981\u529f\u80fd\u6a21\u5757&#xff1a; \u6dfb\u52a0\u5b66\u751f\u4fe1\u606f\u5220\u9664\u5b66\u751f\u4fe1\u606f\u4fee\u6539\u5b66\u751f\u4fe1\u606f\u67e5\u8be2\u5b66\u751f\u4fe1\u606f\u663e\u793a\u6240\u6709\u5b66\u751f\u6570\u636e\u6301\u4e45\u5316&#xff08;JSON\u6587\u4ef6\u5b58\u50a8&#xff09; \u6838\u5fc3\u4ee3\u7801\u5b9e\u73b0 1. \u6570\u636e\u7ed3\u6784\u8bbe\u8ba1 \u6bcf\u4e2a\u5b66\u751f\u4fe1\u606f\u5305\u542b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70631.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-01T22:41:08+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70631.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70631.html\",\"name\":\"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-01T22:41:08+00:00\",\"dateModified\":\"2026-02-01T22:41:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70631.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70631.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70631.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/70631.html","og_locale":"zh_CN","og_type":"article","og_title":"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u597d\u7684&#xff01;\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u5305\u62ec\u57fa\u7840\u529f\u80fd&#xff08;\u589e\u5220\u6539\u67e5&#xff09;\u548c\u6570\u636e\u6301\u4e45\u5316&#xff08;\u4f7f\u7528JSON\u6587\u4ef6\u5b58\u50a8&#xff09;\u3002\u6559\u7a0b\u5305\u542b\u5b8c\u6574\u6e90\u7801\u53ca\u8be6\u7ec6\u6ce8\u91ca\u3002 \u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u8bbe\u8ba1 \u7cfb\u7edf\u4e3b\u8981\u529f\u80fd\u6a21\u5757&#xff1a; \u6dfb\u52a0\u5b66\u751f\u4fe1\u606f\u5220\u9664\u5b66\u751f\u4fe1\u606f\u4fee\u6539\u5b66\u751f\u4fe1\u606f\u67e5\u8be2\u5b66\u751f\u4fe1\u606f\u663e\u793a\u6240\u6709\u5b66\u751f\u6570\u636e\u6301\u4e45\u5316&#xff08;JSON\u6587\u4ef6\u5b58\u50a8&#xff09; \u6838\u5fc3\u4ee3\u7801\u5b9e\u73b0 1. \u6570\u636e\u7ed3\u6784\u8bbe\u8ba1 \u6bcf\u4e2a\u5b66\u751f\u4fe1\u606f\u5305\u542b","og_url":"https:\/\/www.wsisp.com\/helps\/70631.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-01T22:41:08+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70631.html","url":"https:\/\/www.wsisp.com\/helps\/70631.html","name":"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-01T22:41:08+00:00","dateModified":"2026-02-01T22:41:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70631.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70631.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70631.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Python\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\uff1aJSON\u6301\u4e45\u5316\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=70631"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70631\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70631"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}