[Python] Select file by FileNamePattern in python

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    if file.filename == file_name:


    I am currently using this condition to find a file.

    Now I want to change this condition where we don't have file name because It changes everyday. also we get FileNamePattern (for eg. *.xlsx) from db but that also changes everyday depending on new incoming file.

    I tried using

    if fnmatch.fnmatch(file.filename, file_name):


    but it is not correct.

    Continue reading...

Compartilhe esta Página