1

I am not sure what I'm doing wrong. I copied the path link and used it in my code, but I'm still getting the error. Below is my code I am trying to run and the path.

import os
def rename_files():
    file_list = os.listdir("Macintosh HD/Users/engpen/downloads/prank")
    print(file_list)
Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52
Siv
  • 21
  • 1

2 Answers2

0

Rather use. Then check step by step whether your path is correct.

os.path.join()
Auss
  • 451
  • 5
  • 9
0

Guessing a bit here. The path most likely should be /Users/engpen/.... Thus try:

import os
def rename_files():
   file_list = os.listdir("/Users/engpen/downloads/prank")
   print(file_list)
Grzegorz Oledzki
  • 23,614
  • 16
  • 68
  • 106