Python 2.5.2: trying to open files recursively

前端 未结 3 1161
南方客
南方客 2021-01-05 05:38

The script below should open all the files inside the folder \'pruebaba\' recursively but I get this error:

Traceback (most recent call last):
F

3条回答
  •  一生所求
    2021-01-05 06:17

    os.listdir lists both files and directories. You should check if what you're trying to open really is a file with os.path.isfile

提交回复
热议问题