[SOLVED] Python is showing empty list when using os.listdir()


This Content is from Stack Overflow. Question asked by Rohit

This is the line of code:

names = os.listdir(SAVE_PATH + "/temp")

I tried to debug it and the names are an empty list [].

SAVE_PATH is imported from a different file and it is working properly

SAVE_PATH = r"C:UsersrohitDownloadsYouTube"

Files in that folder



In between all those uncommented code I accidentally changed SAVE_PATH which caused this error.

I’m sorry for wasting your time guys.

This Question was asked in StackOverflow by Rohit and Answered by Rohit It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?