1
Good night I am new in Python programming but I created this code using the.listdr and did not return any results of the files inside folder. If anyone has any idea how to handle it, I’d appreciate it. follows the code:
import os
def rename_files():
#(1) Obter nomes de arquivos de uma pasta
file_list = os.listdr(r"C:\Users\Deivid\Pictures\Imagens\prank")
print (file_list)
In mistakes of this kind, the first thing is to use the principle KISS, try to run only with the root of the drive:
file_list = os.listdr(r"C:\")
– Sidon
Thanks for the help friend, I tried to run only the root but did not succeed.
– D.rosario
What was the error msg?
– Sidon
There was no error message, the code compiled but in the shell did not show the contents of the directory, only the cursor was flashing.
– D.rosario