Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

# check if file exists

# check if file exists
from os.path import exists
file_exists = exists("/content/sample_data/california_housing_test.csv")
print(file_exists)
#True

from pathlib import Path
path = Path("/content/sample_data/california_housing_test.csv")
path.is_file()
#False
Source by devarama.com #
 
PREVIOUS NEXT
Tagged: #check #file #exists
ADD COMMENT
Topic
Name
1+5 =