The Python Oracle

How do I check if directory exists in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Quiet Intelligence

--

Chapters
00:00 Question
00:16 Accepted answer (Score 2190)
00:49 Answer 2 (Score 113)
01:35 Answer 3 (Score 93)
01:57 Answer 4 (Score 54)
02:10 Thank you

--

Full question
https://stackoverflow.com/questions/8933...

Accepted answer links:
[os.path.isdir]: http://docs.python.org/dev/library/os.pa...
[os.path.exists]: http://docs.python.org/dev/library/os.pa...
[pathlib]: https://docs.python.org/dev/library/path...

Answer 2 links:
[the ]: https://docs.python.org/3/library/pathli...#
[the pathlib2 module on PyPi.]: https://pypi.python.org/pypi/pathlib2/

Answer 4 links:
[os.path.exists()]: http://docs.python.org/library/os.path.h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #directory

#avk47