1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Tkinter Python Filedialog Certain Files Only?

Discussão em 'Python' iniciado por Stack, Setembro 25, 2021.

  1. Stack

    Stack Membro Participativo

    So I was messing around with the python keyboard module and then I wondered how do I make a file dialog popup when you pressed ctrl+S so I searched stack overflow I quickly found out how to with:

    from tkinter import filedialog

    root = tk.Tk()
    root.withdraw()

    file_path = filedialog.askopenfilename()


    But what I want to know is how can I filter out the files by like *.txt or *.py with the same method. So if anyone has an answer please tell me.

    Continue reading...

Compartilhe esta Página