わかさぎのブログ

プログラミング、Atcoderの勉強とか

tkinterでディレクトリを聞く方法

    def asking_location():
        main_win = tk.Tk()
        main_win.title("タイトル")
        main_win.geometry("400x300")
        label = tk.Label(text="コメント")
        message = tk.Message(text="コメント")
        label.pack()
        message.pack()
        idir = '.'
        filetype=[("all file","*")] 
        global path_loc
        path_loc = tk.filedialog.askdirectory(initialdir = idir)
        return path_loc