Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python is folder or file

import os  
path="abc.txt"  
if os.path.isdir(path):  
    print("
It is a directory")  
elif os.path.isfile(path):  
    print("
It is a normal file")  
else:  
    print("It is a special file (socket, FIFO, device file)" )
print()
 
PREVIOUS NEXT
Tagged: #python #folder #file
ADD COMMENT
Topic
Name
8+3 =