{"id":16298,"date":"2025-04-18T22:48:14","date_gmt":"2025-04-18T14:48:14","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/16298.html"},"modified":"2025-04-18T22:48:14","modified_gmt":"2025-04-18T14:48:14","slug":"%e6%9e%81%e7%ae%80python%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%90%8e%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/16298.html","title":{"rendered":"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef"},"content":{"rendered":"<p>\u5728Python\u4e2d&#xff0c;\u53ef\u4ee5\u4f7f\u7528http.server\u6a21\u5757\u548cjson\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668&#xff0c;\u8be5\u670d\u52a1\u5668\u53ef\u4ee5\u54cd\u5e9480\u7aef\u53e3\u4e0a\u7684\/query POST\u8bf7\u6c42&#xff0c;\u5e76\u4e14\u8bf7\u6c42\u4f53\u4e3aJSON\u683c\u5f0f\u3002 \u9700\u8981\u6ce8\u610f&#xff0c;\u5728Linux\u7cfb\u7edf\u4e0a&#xff0c;\u4f7f\u7528\u4f4e\u4e8e1024\u7684\u7aef\u53e3&#xff08;\u598280\u7aef\u53e3&#xff09;\u9700\u8981root\u6743\u9650\u3002<\/p>\n<p>\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> http<span class=\"token punctuation\">.<\/span>server<br \/>\n<span class=\"token keyword\">import<\/span> socketserver<br \/>\n<span class=\"token keyword\">import<\/span> json<\/p>\n<p><span class=\"token comment\"># \u81ea\u5b9a\u4e49\u8bf7\u6c42\u5904\u7406\u7c7b<\/span><br \/>\n<span class=\"token keyword\">class<\/span> <span class=\"token class-name\">MyHandler<\/span><span class=\"token punctuation\">(<\/span>http<span class=\"token punctuation\">.<\/span>server<span class=\"token punctuation\">.<\/span>SimpleHTTPRequestHandler<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">def<\/span> <span class=\"token function\">do_POST<\/span><span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> self<span class=\"token punctuation\">.<\/span>path <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#039;\/query&#039;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token comment\"># \u83b7\u53d6\u8bf7\u6c42\u4f53\u7684\u957f\u5ea6<\/span><br \/>\n            content_length <span class=\"token operator\">&#061;<\/span> <span class=\"token builtin\">int<\/span><span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">.<\/span>headers<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;Content-Length&#039;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token comment\"># \u8bfb\u53d6\u8bf7\u6c42\u4f53<\/span><br \/>\n            post_data <span class=\"token operator\">&#061;<\/span> self<span class=\"token punctuation\">.<\/span>rfile<span class=\"token punctuation\">.<\/span>read<span class=\"token punctuation\">(<\/span>content_length<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n                <span class=\"token comment\"># \u89e3\u6790JSON\u6570\u636e<\/span><br \/>\n                json_data <span class=\"token operator\">&#061;<\/span> json<span class=\"token punctuation\">.<\/span>loads<span class=\"token punctuation\">(<\/span>post_data<span class=\"token punctuation\">.<\/span>decode<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;utf-8&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token comment\"># \u6253\u5370\u63a5\u6536\u5230\u7684JSON\u6570\u636e<\/span><br \/>\n                <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Received JSON data:&#034;<\/span><span class=\"token punctuation\">,<\/span> json_data<span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token comment\"># \u53d1\u9001\u54cd\u5e94\u5934<\/span><br \/>\n                self<span class=\"token punctuation\">.<\/span>send_response<span class=\"token punctuation\">(<\/span><span class=\"token number\">200<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                self<span class=\"token punctuation\">.<\/span>send_header<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;Content-type&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;application\/json&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                self<span class=\"token punctuation\">.<\/span>end_headers<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token comment\"># \u6784\u9020\u54cd\u5e94\u6570\u636e<\/span><br \/>\n                response_data <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#039;message&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;JSON data received successfully&#039;<\/span><span class=\"token punctuation\">}<\/span><br \/>\n                <span class=\"token comment\"># \u5c06\u54cd\u5e94\u6570\u636e\u8f6c\u6362\u4e3aJSON\u5b57\u7b26\u4e32\u5e76\u53d1\u9001<\/span><br \/>\n                self<span class=\"token punctuation\">.<\/span>wfile<span class=\"token punctuation\">.<\/span>write<span class=\"token punctuation\">(<\/span>json<span class=\"token punctuation\">.<\/span>dumps<span class=\"token punctuation\">(<\/span>response_data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>encode<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;utf-8&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">except<\/span> json<span class=\"token punctuation\">.<\/span>JSONDecodeError<span class=\"token punctuation\">:<\/span><br \/>\n                <span class=\"token comment\"># \u82e5JSON\u89e3\u6790\u5931\u8d25&#xff0c;\u53d1\u9001400\u9519\u8bef\u54cd\u5e94<\/span><br \/>\n                self<span class=\"token punctuation\">.<\/span>send_error<span class=\"token punctuation\">(<\/span><span class=\"token number\">400<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;Bad Request: Invalid JSON data&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">else<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token comment\"># \u82e5\u8bf7\u6c42\u8def\u5f84\u4e0d\u662f\/query&#xff0c;\u53d1\u9001404\u9519\u8bef\u54cd\u5e94<\/span><br \/>\n            self<span class=\"token punctuation\">.<\/span>send_error<span class=\"token punctuation\">(<\/span><span class=\"token number\">404<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;Not Found&#039;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u670d\u52a1\u5668\u7684\u7aef\u53e3\u53f7<\/span><br \/>\nPORT <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">80<\/span><\/p>\n<p><span class=\"token keyword\">with<\/span> socketserver<span class=\"token punctuation\">.<\/span>TCPServer<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> PORT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> MyHandler<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">as<\/span> httpd<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Serving at port <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>PORT<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token comment\"># \u542f\u52a8\u670d\u52a1\u5668<\/span><br \/>\n        httpd<span class=\"token punctuation\">.<\/span>serve_forever<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">except<\/span> KeyboardInterrupt<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Server stopped by user.&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>\u4ee3\u7801\u8bf4\u660e&#xff1a;<\/h4>\n<li>\u81ea\u5b9a\u4e49\u8bf7\u6c42\u5904\u7406\u7c7bMyHandler&#xff1a;\u7ee7\u627f\u81eahttp.server.SimpleHTTPRequestHandler&#xff0c;\u5e76\u91cd\u5199do_POST\u65b9\u6cd5\u6765\u5904\u7406POST\u8bf7\u6c42\u3002<\/li>\n<li>\u5904\u7406\/query\u8bf7\u6c42&#xff1a;\n<ul>\n<li>\u83b7\u53d6\u8bf7\u6c42\u4f53\u7684\u957f\u5ea6&#xff0c;\u5e76\u8bfb\u53d6\u8bf7\u6c42\u4f53\u3002<\/li>\n<li>\u5c1d\u8bd5\u89e3\u6790JSON\u6570\u636e&#xff0c;\u5982\u679c\u89e3\u6790\u6210\u529f&#xff0c;\u6253\u5370\u63a5\u6536\u5230\u7684JSON\u6570\u636e&#xff0c;\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6210\u529f\u6d88\u606f\u7684JSON\u54cd\u5e94\u3002<\/li>\n<li>\u5982\u679cJSON\u89e3\u6790\u5931\u8d25&#xff0c;\u8fd4\u56de400\u9519\u8bef\u54cd\u5e94\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5904\u7406\u5176\u4ed6\u8bf7\u6c42&#xff1a;\u5982\u679c\u8bf7\u6c42\u8def\u5f84\u4e0d\u662f\/query&#xff0c;\u8fd4\u56de404\u9519\u8bef\u54cd\u5e94\u3002<\/li>\n<li>\u542f\u52a8\u670d\u52a1\u5668&#xff1a;\u4f7f\u7528socketserver.TCPServer\u521b\u5efa\u4e00\u4e2aTCP\u670d\u52a1\u5668&#xff0c;\u5e76\u5728\u6307\u5b9a\u7684\u7aef\u53e3\u4e0a\u542f\u52a8\u3002<\/li>\n<h4>\u8fd0\u884c\u4ee3\u7801&#xff1a;<\/h4>\n<p>\u5728Linux\u7cfb\u7edf\u4e0a&#xff0c;\u9700\u8981\u4ee5root\u6743\u9650\u8fd0\u884c\u8be5\u811a\u672c&#xff08;\u4fee\u6539\u7aef\u53e3\u81f31024\u4ee5\u4e0a\u5c31\u4e0d\u9700\u8981root&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> python3 server.py<\/p>\n<h4>\u6d4b\u8bd5\u670d\u52a1\u5668&#xff1a;<\/h4>\n<p>\u4f7f\u7528curl\u547d\u4ee4\u6765\u6d4b\u8bd5\u670d\u52a1\u5668&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-X<\/span> POST <span class=\"token parameter variable\">-H<\/span> <span class=\"token string\">&#034;Content-Type: application\/json&#034;<\/span> <span class=\"token parameter variable\">-d<\/span> <span class=\"token string\">&#039;{&#034;key&#034;: &#034;value&#034;}&#039;<\/span> http:\/\/localhost\/query<\/p>\n<p>\u8fd9\u6837&#xff0c;\u670d\u52a1\u5668\u5c06\u63a5\u6536\u5e76\u89e3\u6790JSON\u6570\u636e&#xff0c;\u5e76\u8fd4\u56de\u4e00\u4e2a\u6210\u529f\u6d88\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb962\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u5757\u548cjson\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\uff0c\u8be5\u670d\u52a1\u5668\u53ef\u4ee5\u54cd\u5e9480\u7aef\u53e3\u4e0a\u7684\/queryPOST\u8bf7\u6c42\uff0c\u5e76\u4e14\u8bf7\u6c42\u4f53\u4e3aJSON\u683c\u5f0f\u3002\u9700\u8981\u6ce8\u610f\uff0c\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528\u4f4e\u4e8e1024\u7684\u7aef\u53e3\uff08\u598280\u7aef\u53e3\uff09\u9700\u8981root\u6743\u9650\u3002<\/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":[81,43],"topic":[],"class_list":["post-16298","post","type-post","status-publish","format-standard","hentry","category-server","tag-python","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \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\/16298.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb962\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u5757\u548cjson\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\uff0c\u8be5\u670d\u52a1\u5668\u53ef\u4ee5\u54cd\u5e9480\u7aef\u53e3\u4e0a\u7684\/queryPOST\u8bf7\u6c42\uff0c\u5e76\u4e14\u8bf7\u6c42\u4f53\u4e3aJSON\u683c\u5f0f\u3002\u9700\u8981\u6ce8\u610f\uff0c\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528\u4f4e\u4e8e1024\u7684\u7aef\u53e3\uff08\u598280\u7aef\u53e3\uff09\u9700\u8981root\u6743\u9650\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/16298.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T14:48:14+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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16298.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/16298.html\",\"name\":\"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T14:48:14+00:00\",\"dateModified\":\"2025-04-18T14:48:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/16298.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/16298.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16298.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef\"}]},{\"@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":"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \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\/16298.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb962\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u5757\u548cjson\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\uff0c\u8be5\u670d\u52a1\u5668\u53ef\u4ee5\u54cd\u5e9480\u7aef\u53e3\u4e0a\u7684\/queryPOST\u8bf7\u6c42\uff0c\u5e76\u4e14\u8bf7\u6c42\u4f53\u4e3aJSON\u683c\u5f0f\u3002\u9700\u8981\u6ce8\u610f\uff0c\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528\u4f4e\u4e8e1024\u7684\u7aef\u53e3\uff08\u598280\u7aef\u53e3\uff09\u9700\u8981root\u6743\u9650\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/16298.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T14:48:14+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/16298.html","url":"https:\/\/www.wsisp.com\/helps\/16298.html","name":"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T14:48:14+00:00","dateModified":"2025-04-18T14:48:14+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/16298.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/16298.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/16298.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6781\u7b80Python\u670d\u52a1\u5668\u540e\u7aef"}]},{"@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\/16298","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=16298"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/16298\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=16298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=16298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=16298"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=16298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}