WinError 2, python cant find my file when os.remove

Viewed 14

printing the name of the files goes fine but when I try to use os.remove it says it cannot find the file. I also tried full path but also didnt work.

here is my code

 import os
 for tempfiles in os.listdir(r"All Posts"):
 os.remove(tempfiles)
0 Answers
Related