“seletor de arquivo tknter” Respostas de código

AskopenFileName

filename2 =  filedialog.askopenfilename(title = "Select file",filetypes = (("Excel files", ".xlsx .xls"),))
Fair Frog

seletor de arquivo tknter

import tkinter as tk
from tkinter import ttk
from tkinter import filedialog as fd

root = tk.Tk()

def select_file():
    filetypes = (
        ('text files', '*.txt'),
        ('All files', '*.*')
    )

    filename = fd.askopenfilename(
        title='Open a file',
        initialdir='/',
        filetypes=filetypes)

    showinfo(
        title='Selected File',
        message=filename
    )


# open button
open_button = ttk.Button(
    root,
    text='Open a File',
    command=select_file
)

open_button.pack(expand=True)
root.mainloop()
AndyIsHereBoi

Respostas semelhantes a “seletor de arquivo tknter”

Perguntas semelhantes a “seletor de arquivo tknter”

Procure respostas de código populares por idioma

Procurar outros idiomas de código