run this one.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:my_research 作者: MorvanZhou 项目源码 文件源码
def button_load_learning_result_clicked(self):
        global episode
        initialdir = os.path.dirname(os.path.realpath(__file__))
        while True:
            if platform.system() == 'Darwin':
                q_index_path = askopenfilename(initialdir=initialdir, message='Choose q_index',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            else:
                q_index_path = askopenfilename(initialdir=initialdir, title='Choose q_index',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            if 'q_index' not in q_index_path:
                messagebox.showwarning(message='Wrong file.')
            else:
                break
        while True:
            if platform.system() == 'Darwin':
                q_table_path = askopenfilename(initialdir=initialdir, message='Choose q_table',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            else:
                q_table_path = askopenfilename(initialdir=initialdir, title='Choose q_table',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            if 'q_table' not in q_table_path:
                messagebox.showwarning(message='Wrong file.')
            else:
                break

        try:
            hunter.q_table = pd.read_pickle(q_table_path)
            hunter.q_index = pd.read_pickle(q_index_path)
            episode = [int(d) for d in q_table_path.split('_') if d.isdigit()][0]
            self.label_episode_v.set('Episode: %s' % episode)
        except Exception as e:
            messagebox.showerror(message=e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号