Answers for "pathlib is directory\"

2

pathlib path get directory of current file

import pathlib
pathlib.Path(__file__).parent.absolute()
Posted by: Guest on April-04-2020
0

check if path is a folder python

import os

# check the if the path is a directory
print(os.path.isdir("path"))

# check if the path is a file
print(os.path.isfile("path"))
Posted by: Guest on August-13-2021

Code answers related to "pathlib is directory\"

Python Answers by Framework

Browse Popular Code Answers by Language