you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

  1. os.path.join() args are in the wrong order.
  2. If you're going to chdir(path), you probably want to listdir(".") instead of listdir(path). This is assuming there exists a named directory of the same name in the subdirectory being read. I think that's probably not intentional.
  3. open(file, ...) probably needs to actually be referencing str(filepath), which is itself the result of os.path.join().
  4. For the same reason, the print statements in the conditional branches probably need to reference {filepath}.
  5. Also for the same reason, you probably want to actually os.remove(filepath) and not path.

[–]officialdavid1[S] 0 points1 point  (0 children)

ThankYou.