{"id":353232,"date":"2021-02-23T13:27:12","date_gmt":"2021-02-23T05:27:12","guid":{"rendered":"http:\/\/4563.org\/?p=353232"},"modified":"2021-02-23T13:27:12","modified_gmt":"2021-02-23T05:27:12","slug":"%e8%af%b7%e9%97%ae%e5%9c%a8-python-%e7%9a%84%e4%ba%8b%e4%bb%b6%e7%b3%bb%e7%bb%9f%e4%b8%ad%ef%bc%8c%e5%a6%82%e4%bd%95%e5%8f%af%e4%bb%a5%e9%80%9a%e8%bf%87%e4%ba%8b%e4%bb%b6%e9%80%9a%e7%9f%a5%e7%ab%8b","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=353232","title":{"rendered":"\u8bf7\u95ee\u5728 Python \u7684\u4e8b\u4ef6\u7cfb\u7edf\u4e2d\uff0c\u5982\u4f55\u53ef\u4ee5\u901a\u8fc7\u4e8b\u4ef6\u901a\u77e5\u7acb\u523b\u7ec8\u7ed3\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u5b50\u7ebf\u7a0b\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u95ee\u5728 Python \u7684\u4e8b\u4ef6\u7cfb\u7edf\u4e2d\uff0c\u5982\u4f55\u53ef\u4ee5\u901a\u8fc7\u4e8b\u4ef6\u901a\u77e5\u7acb\u523b\u7ec8\u7ed3\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u5b50\u7ebf\u7a0b\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u6700\u8fd1\u5728\u5b8c\u5584\u624b\u5934\u4e0a\u4e00\u4e2a\u57fa\u4e8e\u4e8b\u4ef6\u7cfb\u7edf\u7684 GUI \u3002<\/p>\n<p>\u73b0\u5728\u9047\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u5f53\u6211\u5728\u6267\u884c\u4e00\u4e2a\u6309\u94ae\u70b9\u51fb\u4e8b\u4ef6\u7684\u65f6\u5019\uff0c\u5b9e\u9645\u4f1a\u5f00\u4e00\u4e2a\u5b50\u7ebf\u7a0b\u8fdb\u884c\u4e1a\u52a1\u903b\u8f91\u7684\u5904\u7406\uff0c\u8fd9\u4e2a\u5904\u7406\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u6bd4\u8f83\u957f\uff0c\u5e76\u4e14\u4e2d\u95f4\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u4e0d\u7b26\u5408\u9884\u671f\u7684\u60c5\u51b5\u53d1\u751f\uff0c\u5f53\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u65f6\uff0c\u6211\u5e0c\u671b\u4f1a\u501f\u7531\u53d1\u9001\u4e00\u4e2a\u9519\u8bef\u7684\u4e8b\u4ef6\u901a\u77e5 EventManager\uff0c\u7136\u540e\u8c03\u7528 listener \u7684\u65b9\u6cd5\u6765\u7acb\u523b\u7ec8\u7ed3\u8fd9\u4e2a\u5bf9\u5e94\u7684\u9519\u8bef\u7ebf\u7a0b\uff08\u56e0\u4e3a\u4e4b\u524d\u5df2\u7ecf\u53d1\u751f\u4e86\u9519\u8bef\u4e86\uff0c\u540e\u7eed\u903b\u8f91\u4ee3\u7801\u7ee7\u7eed\u6267\u884c\u6ca1\u6709\u610f\u4e49\u4e86\uff09<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b\uff0c\u5927\u4f6c\u4eec\u76f4\u63a5\u590d\u5236\u8fd0\u884c\u5373\u53ef\u89c2\u5bdf\u3002\u5982\u80fd\u89e3\u7b54\uff0c\u4e07\u5206\u611f\u8c22\uff01<\/p>\n<pre><code>from queue import Queue, Empty from threading import * from tkinter import * import time from tkinter import ttk  EVENT_TYPE_1 = \"Count\" EVENT_TYPE_2 = \"Error\" MAX_NUMBER = 10 CUR_NUMBER = 0   class event_manager:     def __init__(self):         self._eventQueue = Queue()         self._thread = Thread(target=self.Run, daemon=True)         self._handlers = {}         self._active = False      def Start(self):         self._active = True         self._thread.start()      def Run(self):         while self._active is True:             try:                 event = self._eventQueue.get(block=True, timeout=1)                 self.Process(event)             except Empty:                 pass      def Process(self, event):         if event.type in self._handlers:             for handler in self._handlers[event.type]:                 handler()         else:             pass      def Stop(self):         self._active = False         self._thread.join()      def addEventListenter(self, type_, handler):         try:             handlerList = self._handlers[type_]          except KeyError:             handlerList = []             self._handlers[type_] = handlerList          if handler not in handlerList:             handlerList.append(handler)      def removeEventListenter(self, type_, handler):         try:             handlerList = self._handlers[type_]             if handler in handlerList:                 handlerList.remove(handler)             if not handlerList:                 del self._handlers[type_]         except KeyError:             pass      def sendEvent(self, event):         self._eventQueue.put(event)   class Event:     def __init__(self, event_event_name, cur_done_task, type_=None):         self.type = type_         self._event_name = event_event_name         self._curDoneTask = cur_done_task   class EventSource:     def __init__(self, event_name, event_mgr, max_number, type):         self._event_name = event_name         self._event_manager = event_mgr         self._type = type         self._max_number = max_number      def count(self):         global CUR_NUMBER         for i in range(self._max_number):             CUR_NUMBER = i + 1              if CUR_NUMBER == 4:  # \u5728\u4e1a\u52a1\u903b\u8f91\u7ebf\u7a0b\u4e2d\u589e\u52a0\u68c0\u6d4b\u73af\u8282\uff0c\u5982\u679c\u53d1\u751f\u9519\u8bef\u5c31\u4f1a\u53d1\u9001\u9519\u8bef\u4e8b\u4ef6\uff0c\u5e0c\u671b\u53ef\u4ee5\u7acb\u523b\u7ec8\u7ed3\u5f53\u524d\u7684\u7ebf\u7a0b\uff0c\u4e0d\u6267\u884c\u540e\u7eed\u7684\u4ee3\u7801                 print(\"************ detect error occurred , this thread should be terminated immediately !\")                 errorEvent = Event(\"error\", CUR_NUMBER, type_=EVENT_TYPE_2)                 self._event_manager.sendEvent(errorEvent)              print(                 \"************ main thread start\uff1anow start process {} - count : {}\".format(self._event_name, CUR_NUMBER))             event = Event(\"test\", CUR_NUMBER, type_=self._type)             self._event_manager.sendEvent(event)             time.sleep(1)   class GUIListener(Tk):     def __init__(self):         super(GUIListener, self).__init__()          self.title(\"Progress GUI\")         self.geometry(\"1200x805+600+100\")         self.config(bg=\"#535353\")         self.resizable(True, True)         self.taskThread = None          self.progressBar = ttk.Progressbar(master=self, orient=HORIZONTAL, maximum=MAX_NUMBER, length=300)         self.progressBar.pack()         self.button = ttk.Button(self, text=\"Run\", command=lambda: self.button_function(MAX_NUMBER))         self.button.pack()      def update_progress_value(self):         print(\"************Sub thread start: detect progress bar value is now...{}\".format(self.progressBar['value']))         self.progressBar['value'] = CUR_NUMBER         self.progressBar.update_idletasks()         print(\"************Sub thread start: update progress bar value to...{}\".format(CUR_NUMBER))      def button_function(self, max_number):         # \u5728\u6b63\u5f0f\u5f00\u59cb\u6267\u884c\u903b\u8f91\u5b50\u7ebf\u7a0b\u4e4b\u524d\uff0c\u786e\u5b9e\u53ef\u4ee5\u63d0\u524d\u505a\u4e00\u4e9b\u5224\u65ad\uff0c\u6765\u51b3\u5b9a\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u5f00\u59cb\u63a5\u4e0b\u6765\u7684\u903b\u8f91\u5b50\u7ebf\u7a0b\uff0c\u4f46\u662f\u8fd9\u4e2a\u4e0d\u5728\u672c\u6b21\u8ba8\u8bba\u8303\u56f4\u5185         es = EventSource(\"eventSource\", eventMgr, max_number, EVENT_TYPE_1)         self.taskThread = Thread(target=es.count, daemon=True).start()  # \u8fd9\u91cc\u5f00\u59cb\u6267\u884c\u5b9e\u9645\u7684\u4e1a\u52a1\u903b\u8f91\u5b50\u7ebf\u7a0b      def terminate_error_thread(self):  # \u8fd9\u4e2a\u65b9\u6cd5\u5728 GUIListener \u63a5\u53d7\u5230\u4e8b\u4ef6\u6e90\u53d1\u51fa\u7684\u9519\u8bef\u903b\u8f91\u65f6\u88ab\u5524\u8d77\uff0c\u7528\u6765\u7acb\u523b\u7ec8\u7ed3\u6b63\u5728\u6267\u884c\u4e8b\u4ef6\u6e90\u7684\u7ebf\u7a0b\uff0c\u4e0d\u505a\u540e\u7eed\u65e0\u7528\u7684\u4ee3\u7801\u903b\u8f91\u5904\u7406         pass         # TODO: but how to implement this method \uff1f   if __name__ == '__main__':     gui = GUIListener()      eventMgr = event_manager()     eventMgr.addEventListenter(EVENT_TYPE_1, gui.update_progress_value)     eventMgr.addEventListenter(EVENT_TYPE_2, gui.terminate_error_thread)      eventMgr.Start()      gui.mainloop()  <\/code><\/pre>\n<p>\u987a\u4fbf\u4e00\u63d0\uff0c\u5e0c\u671b\u5f97\u5230\u7684\u7ed3\u679c\u662f\u8fd9\u6837\u7684<\/p>\n<pre><code>************ main thread start\uff1anow start process eventSource - count : 1 ************Sub thread start: detect progress bar value is now...0.0 ************Sub thread start: update progress bar value to...1 ************ main thread start\uff1anow start process eventSource - count : 2 ************Sub thread start: detect progress bar value is now...1 ************Sub thread start: update progress bar value to...2 ************ main thread start\uff1anow start process eventSource - count : 3 ************Sub thread start: detect progress bar value is now...2 ************Sub thread start: update progress bar value to...3 ************ detect error occurred , this thread should be terminated immediately ! <\/code><\/pre>\n<p>\u5230\u8fd9\u91cc\u5c31\u5e94\u8be5\u81ea\u7136\u505c\u6b62\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5342074\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ch2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.jb51.net\/article\/71908.htm                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342075\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             emmmmm,\u770b\u4e86\u4e00\u4e0b\u4e0a\u5927\u4f6c\u7684\u94fe\u63a5\uff0c\u5927\u610f\u662f\u6211\u9700\u8981\u91cd\u65b0\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u4e86\u7ebf\u7a0b\u7684\u7c7b\uff0c\u7136\u540e\u91cd\u5199\u8fd9\u4e2a\u7c7b\u4e0b\u7684 stop \u65b9\u6cd5\uff08\u7528\u4e00\u4e2a\u5e03\u5c14\u503c\u7684\u5f00\u5173\u6765\u63a7\u5236 thread \u7684 run \u65b9\u6cd5\uff09\u3002<br \/>\u5728\u6211\u7684\u4ee3\u7801\u793a\u4f8b\u4e2d\uff0c\u5c31\u662f\u6bcf\u6b21\u53d1\u9001\u51fa\u9519\u8bef\u4e8b\u4ef6\u7684\u65f6\u5019\uff0c\u901a\u77e5\u4fee\u6539\u8fd9\u4e2a\u5e03\u5c14\u503c\u5f00\u5173 [\u8bbe\u4e3a\u5168\u5c40\u53d8\u91cf] \u53d8\u4e3a False \u7136\u540e\u81ea\u7136\u4f7f\u5f97\u63a5\u4e0b\u6765\u7684\u7ebf\u7a0b\u81ea\u52a8\u8df3\u51fa run \u65b9\u6cd5\uff1f<br \/>\u4e0d\u597d\u610f\u601d\uff0c\u6211\u63a5\u89e6 python \u65f6\u95f4\u8fd8\u4e0d\u591f\u957f\u4e45\uff0c\u6709\u4e9b\u5730\u65b9\u7406\u89e3\u529b\u8fd8\u4e0d\u662f\u5f88\u5f3a\uff0c\u5982\u679c\u6709\u8bf4\u9519\u8bf7\u6307\u6b63\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342076\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : todd7zhang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5b50\u7ebf\u7a0b\u5904\u7406\u903b\u8f91\uff0c\u4e2d\u95f4\u53ef\u80fd\u4f1a\u6709\u5f02\u5e38\uff0c\u7136\u540e\u5b50\u7ebf\u7a0b\u53d1\u4e8b\u4ef6\u7ed9 manager\uff0c\u7136\u540e\u8ba9 manager \u6765\u7ed3\u675f\u8fd9\u4e2a\u5b50\u7ebf\u7a0b\uff1f<br \/>\u5982\u679c\u662f\u8fd9\u6837\u7684\u8bdd\uff0c\u4e3a\u5565\u4e0d\u662f\u5b50\u7ebf\u7a0b\u4e2d\u95f4\u51fa\u9519\u4e86\uff0c\u81ea\u5df1\u9000\u51fa\u4e0d\u5c31\u884c\u4e86\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342077\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @todd7zhang \u7406\u60f3\u60c5\u51b5\u4e0b\u6211\u662f\u5e0c\u671b\u53ef\u4ee5\u501f\u52a9\u53d1\u9001 event \u6765\u7ec8\u7ed3\u5f53\u524d\u7684\u5b50\u7ebf\u7a0b\uff0c\u56e0\u4e3a event \u53ef\u4ee5\u5e26\u51fa\u6765\u9519\u8bef\u7684\u5404\u79cd\u4fe1\u606f\u3002\u5bf9\u540e\u7eed\u5904\u7406\u4f1a\u5f88\u6709\u5e2e\u52a9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342078\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u53ef\u4ee5\u76f4\u63a5 eventMgr.Stop() \u6765\u505c\u6b62<br \/>\u4e0d\u8981\u5728 GUIListener \u91cc\u5199 event_manager \u7684\u505c\u6b62\u903b\u8f91<\/p>\n<p>&#8211; eventMgr.addEventListenter(EVENT_TYPE_2, gui.terminate_error_thread)<br \/>+ eventMgr.addEventListenter(EVENT_TYPE_2, eventMgr.Stop)<\/p>\n<p>\u4f46\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f\uff0c\u8bf7\u7528 weakref \u66ff\u6362\u8fd9\u4e00 call                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342079\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @no1xsyzy \u62b1\u6b49\u5c0f\u5f1f\u6211\u624d\u758f\u5b66\u6d45\uff0c\u8fd9\u91cc\u7684 weakref \u662f\u5982\u4f55\u66ff\u6362\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342080\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : imn1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ee3\u7801\u5c31\u4e0d\u9605\u8bfb\u4e86\uff0c\u6ca1\u7a7a\u53bb\u7814\u7a76\u903b\u8f91<\/p>\n<p>\u7b80\u5355\u7684\u505a\u6cd5\uff0c\u5c31\u662f\u4e3b\u7ebf\u7a0b\u7acb\u4e00\u4e2a flag\uff0c\u5b50\u7ebf\u7a0b\u8bfb\u53d6\u8fd9\u4e2a flag\uff0c\u53d8\u66f4\u5c31\u8df3\u51fa\u5faa\u73af\uff08\u6bcf\u6b21\u5faa\u73af\u5224\u65ad\uff09\uff0c\u8df3\u51fa\u540e\u91cd\u7f6e flag\uff0c\u7ed3\u675f\u5b50\u7ebf\u7a0b\uff0c\u8981\u786e\u4fdd\u5176\u4ed6\u63a7\u4ef6\u7684\u4e8b\u4ef6\u53ef\u4ee5\u66f4\u6539\u8fd9\u4e2a flag\uff0cGUI \u505a\u8fd9\u4e2a\u4e0d\u592a\u96be<\/p>\n<p>\u7c97\u7565\u770b\uff0c\u4f60\u7684\u4ee3\u7801\u662f\u5728\u4e3b\u7ebf\u7a0b loop \uff1f\u5e94\u8be5\u653e\u5230\u5b50\u7ebf\u7a0b\uff0c\u8fd9\u6837\u4e3b\u7ebf\u7a0b\u624d\u80fd\u63a5\u6536\u5176\u4ed6\u4e8b\u4ef6                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342081\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @imn1 \u4ed6\u8fd9\u4e0d\u662f\u4e3b\u7ebf\u7a0b loop\uff0c\u4e3b\u7ebf\u7a0b\u5728 gui<\/p>\n<p>@seventhbible \u4f60\u8fd9\u91cc eventMgr \u5728 globals \u91cc\uff0c\u4e0d\u597d\u8c03\uff0c\u4e5f\u4e0d\u60f3\u5e2e\u4f60\u5927\u4fee\uff0c\u4f60\u968f\u4fbf\u5730\u770b\u4e00\u4e0b\u5b98\u65b9\u7684 weakref \u5b9e\u73b0\u5427\uff08\u4e0d\u662f\u6307 C \u5b9e\u73b0\uff0c\u800c\u662f\u6709\u4e86 _weakref.ref \u4e4b\u540e\u5982\u4f55\u5b9e\u73b0\u5176\u4ed6\u7684\u5de5\u5177\uff09\u3002<br \/>\u5f53\u7136\uff0c\u56e0\u4e3a\u5b83\u5728 globals \u91cc\u9762\uff0c\u4f30\u8ba1\u4e0d\u4fee\u4e5f\u6ca1\u4e8b\u513f\u3002\u6211\u8bf4\u7684\u5185\u5b58\u6cc4\u6f0f\u662f eventMgr \u5faa\u73af\u5f15\u7528\u81ea\u8eab\u3002<\/p>\n<p>any( hanlder.__self__ is eventMgr for handler in eventMgr._handlers[EVENT_TYPE_2] )                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342082\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5927\u4f6c\u4eec\u7684\u56de\u590d\uff0c\u53ef\u80fd\u662f\u4e00\u4e0b\u5b50\u77e5\u8bc6\u51fa\u73b0\u65ad\u5c42\u4e86\uff0c\u6211\u5148\u8865\u4e00\u4e0b\u5176\u4ed6\u77e5\u8bc6\u3002\u5982\u679c\u4e0d\u61c2\u518d\u95ee\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342083\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ec0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5b50\u7ebf\u7a0b\u81ea\u5df1\u9000\u51fa\uff0c\u9000\u51fa\u524d\u53d1\u9001 event<\/p>\n<p>\u6bd4\u5982\u5728 count \u51fd\u6570\u4e2d<\/p>\n<p>if CUR_NUMBER == 4:<br \/>(\u7f29\u8fdb)errorEvent = Event(&#8220;error&#8221;, CUR_NUMBER, type_=EVENT_TYPE_2)<br \/>(\u7f29\u8fdb)self._event_manager.sendEvent(errorEvent)<br \/>(\u7f29\u8fdb)return<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4 event \u53ea\u662f\u4f20\u9012\u6d88\u606f\uff0c\u7ebf\u7a0b\u7684\u7ec8\u7ed3\u4ea4\u7ed9\u5b50\u7ebf\u7a0b\u81ea\u5df1                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342084\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ec0 \u5bf9\uff01\u8fd9\u4e5f\u662f\u4e00\u79cd\u65b9\u6cd5\uff0c\u611f\u8c22\u5927\u4f6c\u56de\u590d\u3002\u4f46\u662f\u5982\u679c\u6211\u9700\u8981\u5c06\u8fd9\u4e2a\u5c01\u88c5\u6210\u4e00\u4e2a\u4f20\u53c2\u7684\u901a\u7528\u65b9\u6cd5 check_error \u7684\u8bdd\uff0c\u4ece\u7ed3\u6784\u4e0a\u6765\u8bf4\u5b83\u5e94\u8be5\u5c5e\u4e8e\u54ea\u91cc\u5462\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342085\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ec0 \u800c\u4e14\u8fd9\u6837\u7684\u8bdd\u7ebf\u7a0b\u5e76\u4e0d\u4f1a\u81ea\u5df1\u7ed3\u675f\uff0c\u4f1a\u65e0\u9650\u5faa\u73af\u8fd9\u4e2a for \u5faa\u73af\uff0c\u4ece 1 \u5230 3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5342086\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : seventhbible <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ec0 \u786e\u5b9e\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\uff0c\u6211\u521a\u521a\u8bf4\u9519\u4e86\u3002\u3002\u3002\u4f46\u662f\u8bf7\u95ee\u6709\u6ca1\u6709\u4e00\u79cd\u7edf\u4e00\u7684\u65b9\u6cd5\u7531\u9519\u8bef\u4e8b\u4ef6\u5524\u8d77\u4e00\u4e2a\u901a\u7528\u7684\u65b9\u6cd5\u6765\u9000\u51fa\u7279\u5b9a\u7684\u5b50\u7ebf\u7a0b\uff1f\u56e0\u4e3a\u53ef\u80fd\u6211\u5904\u7406\u4e0d\u540c\u5b50\u7ebf\u7a0b\u7684\u903b\u8f91\u4e1a\u52a1\u90fd\u4f1a\u5f88\u591a\uff0c\u6bcf\u4e2a\u903b\u8f91\u4e1a\u52a1\u7684\u5224\u65ad\u9519\u8bef\u6761\u4ef6\u4e94\u82b1\u516b\u95e8\uff0c\u5982\u679c\u53ef\u4ee5\u7684\u8bdd\uff0c\u6211\u5e0c\u671b\u53ea\u8981\u5b50\u7ebf\u7a0b\u51fa\u73b0\u5f02\u5e38\uff0c\u5c31\u7edf\u4e00\u53d1\u9001\u9519\u8bef\u4fe1\u606f\uff0c\u4ea4\u7531\u4e8b\u4ef6\u7ba1\u7406\u5668\u5524\u8d77\u4e00\u4e2a\u7edf\u4e00\u7684\u65b9\u6cd5\u6765\u9000\u51fa\u8fd9\u4e2a\u5b50\u7ebf\u7a0b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u95ee\u5728 Python \u7684\u4e8b\u4ef6\u7cfb\u7edf\u4e2d&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/353232"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=353232"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/353232\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353232"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}