Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: word guessing game python 
Python :: string to array python 
Python :: python json check if key exists 
Python :: how to map longitude and latitude in python 
Python :: python start with 
Python :: Play Audio File In Background Python 
Python :: how to run django in jupyter 
Python :: python count values in list 
Python :: how to capitalize first letter in python 
Python :: Remove empty strings from the list of strings 
Python :: how to change case of string in python 
Python :: python b before string 
Python :: euclidean distance python 3 variables 
Python :: how to print a column from csv file in python 
Python :: if main 
Python :: python getters and setters 
Python :: Django custome login 
Python :: discord.py send image from url 
Python :: python working directory 
Python :: python arguments 
Python :: joining two lists in python 
Python :: match python 3.10 
Python :: set xlim histogram python 
Python :: Game of Piles Version 2 
Python :: how to add new column in csv file using pandas 
Python :: dataframe to ftp 
Python :: python program to print ASCII characters in lowercase 
Python :: replace matrix values python 
Python :: how to view all attributes and methods of an object python 
Python :: how to delete an item from a list python 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =