file detection Flashcards
1
Q
what is the import function required
A
import os
2
Q
function to detect if a files path exists
A
if os.path.exists(path):
3
Q
functino to detect if the path is a file
A
if os.path.isfile(path):
4
Q
funciton to detect if path is a directory
A
elif os.path.isdir(path):
5
Q
A