os.path.isdir() returns False even when folder exists

后端 未结 3 974
无人共我
无人共我 2020-12-19 10:06

I\'m currently writing a script which has to check if all specified folders actually exist. I found out I have to use os.path.isdir() with absolute paths.

I have t

3条回答
  •  攒了一身酷
    2020-12-19 10:58

    Rather than use \, you might want to use the os.path.sep so that your code works on other platforms, then you don't have to escape these either.

提交回复
热议问题