{"id":4560,"date":"2020-04-13T19:54:20","date_gmt":"2020-04-13T11:54:20","guid":{"rendered":"https:\/\/vip.fxxkpython.com\/?p=4560"},"modified":"2020-04-13T19:54:22","modified_gmt":"2020-04-13T11:54:22","slug":"python-%e7%88%ac%e9%98%b6%e6%a2%af-python-%e6%93%8d%e4%bd%9csocket-%e4%b9%8b%e8%81%8a%e5%a4%a9%e5%ae%a4%e5%ae%a2%e6%88%b7%e7%ab%af%e7%9a%84%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=4560","title":{"rendered":"Python \u722c\u9636\u68af | Python \u64cd\u4f5csocket \u4e4b\u804a\u5929\u5ba4\u5ba2\u6237\u7aef\u7684\u5b9e\u73b0"},"content":{"rendered":"\n<p>\u4eca\u5929\u6211\u4eec\u6765\u5b9e\u73b0\u804a\u5929\u5ba4\u7684\u5ba2\u6237\u7aef\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u5ba2\u6237\u7aef\u7684\u64cd\u4f5c\u8d8a\u50bb\u74dc\u5f0f\u8d8a\u597d\uff0c\u6211\u4eec\u4e3b\u8981\u5b9e\u73b0\u8fd9\u6837\u7684\u529f\u80fd\uff1a<\/p>\n\n\n\n<ul><li>\u7528\u6237\u53ef\u4ee5\u53ea\u7ba1\u7684\u8fd0\u884c\u4e00\u4e2a\u804a\u5929\u5ba4\u8f6f\u4ef6<\/li><li>\u53ef\u4ee5\u5728\u91cc\u9762\u770b\u5230\u6240\u6709\u804a\u5929\u5ba4\u7528\u6237\u7684\u6d88\u606f<\/li><li>\u81ea\u5df1\u53ef\u4ee5\u7f16\u8f91\u6d88\u606f\u8fdb\u884c\u53d1\u9001<\/li><\/ul>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 tkinter \u8fd9\u4e2a\u5e93\u6765\u5199\u4e00\u4e9b Python \u7684 GUI \uff0c\u4e5f\u5c31\u662f\u5ba2\u6237\u7aef\u7684\u804a\u5929\u754c\u9762\uff0c\u9996\u5148\u5bfc\u5165 tk \u5e93\uff0c\u7136\u540e\u5b9a\u4e49\u4e00\u4e0b\u6807\u9898\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"287\" height=\"68\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-32-26.png\" alt=\"\" class=\"wp-image-4562\"\/><\/figure><\/div>\n\n\n\n<p>\u8fd0\u884c\u4e00\u4e0b\u5c31\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"200\" height=\"230\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-32-23.png\" alt=\"\" class=\"wp-image-4563\"\/><\/figure><\/div>\n\n\n\n<h2>\u521b\u5efa\u804a\u5929\u754c\u9762\u5e03\u5c40<\/h2>\n\n\n\n<h3>\u521b\u5efa\u9762\u677f<\/h3>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u521b\u5efa\u804a\u5929\u754c\u9762\u7684\u5e03\u5c40\uff0c\u5148\u5b9a\u4e49\u4e09\u4e2a\u9762\u677f\uff0c\u5206\u522b\u662f\u7528\u6765\u770b\u6d88\u606f\u7684\u9762\u677f\uff0c\u8f93\u5165\u6d88\u606f\u7684\u9762\u677f\uff0c\u4ee5\u53ca\u53d1\u9001\u6d88\u606f\u7684\u9762\u677f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"536\" height=\"62\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-35-42.png\" alt=\"\" class=\"wp-image-4564\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-35-42.png 536w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-35-42-300x35.png 300w\" sizes=\"(max-width: 536px) 100vw, 536px\" \/><\/figure><\/div>\n\n\n\n<h3>\u521b\u5efa\u6587\u672c\u548c\u6309\u94ae<\/h3>\n\n\n\n<p>\u6d88\u606f\u9762\u677f\u548c\u53d1\u9001\u6d88\u606f\u9762\u677f\u90fd\u662f Text \uff0c \u800c\u53d1\u9001\u7684\u64cd\u4f5c\u9700\u8981\u7528\u5230 Button\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"453\" height=\"64\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-40-00.png\" alt=\"\" class=\"wp-image-4565\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-40-00.png 453w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-40-00-300x42.png 300w\" sizes=\"(max-width: 453px) 100vw, 453px\" \/><\/figure><\/div>\n\n\n\n<h3>\u5bb9\u5668\u4f4d\u7f6e\u6392\u653e<\/h3>\n\n\n\n<p>\u6d88\u606f\u7a97\u53e3\u4f4d\u4e8e\u7b2c 1 \u884c\uff0c\u6d88\u606f\u8f93\u5165\u7a97\u53e3\u4f4d\u4e8e\u7b2c 2 \u884c\uff0c\u53d1\u9001\u6309\u94ae\u4f4d\u4e8e\u7b2c\u4e09\u884c\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"472\" height=\"59\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-42-05.png\" alt=\"\" class=\"wp-image-4566\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-42-05.png 472w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-42-05-300x38.png 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/figure><\/div>\n\n\n\n<h3>\u56fa\u5b9a\u5bb9\u5668\u5927\u5c0f<\/h3>\n\n\n\n<p>\u53ef\u4ee5\u4f7f\u7528 grid_propagate \u6765\u56fa\u5b9a\u5404\u4e2a\u9762\u677f\u7684\u5927\u5c0f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"348\" height=\"61\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-43-10.png\" alt=\"\" class=\"wp-image-4567\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-43-10.png 348w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-43-10-300x53.png 300w\" sizes=\"(max-width: 348px) 100vw, 348px\" \/><\/figure><\/div>\n\n\n\n<h3>\u6587\u672c\u6309\u94ae\u6dfb\u52a0\u5230\u5bb9\u5668\u4e2d<\/h3>\n\n\n\n<p>\u6700\u540e\u5c06\u521a\u521a\u5b9a\u4e49\u7684 text \u548c Button \u5f04\u8fdb\u6765\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"217\" height=\"60\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-45-49.png\" alt=\"\" class=\"wp-image-4568\"\/><\/figure><\/div>\n\n\n\n<p>\u8fd0\u884c\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"486\" height=\"484\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-46-22.png\" alt=\"\" class=\"wp-image-4569\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-46-22.png 486w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-46-22-150x150.png 150w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Screenshot-from-2020-04-13-17-46-22-300x300.png 300w\" sizes=\"(max-width: 486px) 100vw, 486px\" \/><\/figure><\/div>\n\n\n\n<p>\u8fd9\u6837\u6211\u4eec\u7684\u804a\u5929\u754c\u9762\u5c31\u505a\u597d\u4e86\uff0c\u63a5\u4e0b\u6765\u9700\u8981\u7ed1\u5b9a\u4e00\u4e0b\u4e8b\u4ef6\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u6211\u4eec\u70b9\u51fb\u53d1\u9001\u6309\u94ae\u7684\u65f6\u5019\uff0c\u5e94\u8be5\u8981\u89e6\u53d1\u4e00\u4e2a\u4e8b\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u5c06\u8f93\u5165\u6846\u4e2d\u7684\u5185\u5bb9\u53d1\u9001\u7ed9 socket \u670d\u52a1\u7aef\u3002<\/p>\n\n\n\n<h2>\u53d1\u9001\u4e8b\u4ef6\u7ed1\u5b9a<\/h2>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u5728\u521a\u521a\u5b9a\u4e49\u7684 Button \u4e2d\u4f7f\u7528 command \u53c2\u6570\u6765\u7ed1\u5b9a\u65b9\u6cd5\uff0c\u4ece\u800c\u5b9e\u73b0\u70b9\u51fb\u53d1\u9001\u6309\u94ae\u65f6\u5019\u7684\u89e6\u53d1\uff1a<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D4560\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div>\u53ef\u4ee5\u63a5\u6536\u5230\u6d88\u606f\u4e86\uff0c\u6211\u4eec\u8ba9\u4ed6\u4eec\u804a\u8d77\u6765\u770b\u770b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"994\" height=\"494\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/04\/Peek-2020-04-13-19-49.gif\" alt=\"\" class=\"wp-image-4590\"\/><\/figure>\n\n\n\n<p>ok\uff0c\u8fd9\u6837\u804a\u5929\u5ba4\u7684\u4e3b\u8981\u529f\u80fd\u5c31\u5b9e\u73b0\u5566\uff0c\u5f53\u7136\u8fd8\u6709\u4e00\u4e9b\u5c0f\u5730\u65b9\u53ef\u4ee5\u4f18\u5316\uff0c\u8fd9\u4e24\u7bc7\u4e3b\u8981\u8fd8\u662f\u8ddf\u4f60\u8bf4\u8bf4 socket \u7684\u5e94\u7528\uff0c\u4ee5\u4e0a\u6d89\u53ca\u7684\u4ee3\u7801\u4f1a\u4f20\u5230\u6211\u4eec\u7684 GitHub \u4e2d\u53bb\uff0c\u4f60\u53ef\u4ee5\u62ff\u53bb\u7ec3\u7ec3\u624b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u6211\u4eec\u6765\u5b9e\u73b0\u804a\u5929\u5ba4\u7684\u5ba2\u6237\u7aef\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u5ba2\u6237\u7aef\u7684\u64cd\u4f5c\u8d8a\u50bb\u74dc\u5f0f\u8d8a\u597d\uff0c\u6211\u4eec\u4e3b\u8981\u5b9e\u73b0\u8fd9\u6837\u7684\u529f\u80fd\uff1a \u7528\u6237\u53ef\u4ee5\u53ea\u7ba1\u7684\u8fd0\u884c\u4e00\u4e2a\u804a\u5929\u5ba4\u8f6f\u4ef6 \u53ef\u4ee5\u5728\u91cc\u9762\u770b\u5230\u6240\u6709\u804a\u5929\u5ba4\u7528\u6237\u7684\u6d88\u606f \u81ea\u5df1\u53ef\u4ee5\u7f16\u8f91\u6d88\u606f\u8fdb\u884c\u53d1\u9001 \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 tkinter \u8fd9\u4e2a\u5e93\u6765\u5199\u4e00\u4e9b Python \u7684&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4591,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[140],"tags":[380,387,391,389,390,388],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/4560"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4560"}],"version-history":[{"count":2,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/4560\/revisions"}],"predecessor-version":[{"id":4592,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/4560\/revisions\/4592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/media\/4591"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}