[Python] Only the last file is shown when typing os.path.splitext()

Discussão em 'Python' iniciado por Stack, Fevereiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    I want to rename files and delete the last 4 characters (_RRR) in each of the files. All the files are shown when I run os.listdir. when splitting into tupple, only the last file gets displayed.

    file_name, file_ext = os.path.splitext()
    print(revit_name)


    After typing file_name, only the last filename is shown and not the rest. Please help Thanks!

    Continue reading...

Compartilhe esta Página