Template request | Bug report | Generate Data Product
Tags: #os #python #path #file #system #library #snippet #operations #check
Author: Benjamin Filly
Description: This notebook will show how to check a path exist using os library.
References:
import os
path
: file path in your local system. If you are using Naas you should start with/home/ftp
to locate your file
path = '/home/ftp/__templates__' # Specify path
This function will check the precise location of the file or directory in a file system you put in the variable
is_exist = os.path.exists(path) # Check whether the specified path exists or not
print("Is the path existing ?")
print(is_exist)