Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to get what type of file in python

import os

# unpacking the tuple
file_name, file_extension = os.path.splitext("/Users/pankaj/abc.txt")

print(file_name)
#returns abc
print(file_extension)
#returns .txt
Comment

how to get what type of file a file is in python


import os

# unpacking the tuple
file_name, file_extension = os.path.splitext("/Users/pankaj/abc.txt")

print(file_name)
#returns abc
print(file_extension)
#returns .txt
Comment

PREVIOUS NEXT
Code Example
Python :: plot horizontal line in python 
Python :: pandas correlation 
Python :: rename columns in dataframe 
Python :: align columns to left pandas python 
Python :: spacy remove stop words 
Python :: ses mail name 
Python :: add y axis label matplotlib 
Python :: sorting pandas dataframe like excel 
Python :: python create a matrix with one in diagonal 
Python :: python filter a dictionary 
Python :: store all files name in a folder python 
Python :: csv write without new line 
Python :: Python find inverse of matrix 
Python :: python basename 
Python :: python multi line print 
Python :: emoji in python 
Python :: find the number of nan per column pandas 
Python :: how can I plot model in pytorch 
Python :: password combination python 
Python :: how to remove duplicate files from folder with python 
Python :: python download s3 image 
Python :: dropping columns in pandas 
Python :: linkedin dynamic scrolling using selenium python 
Python :: write number of lines in file python 
Python :: python zfill 
Python :: get last file in directory python 
Python :: remove spaces from a list python 
Python :: how to remove first letter of a string python 
Python :: remove empty rows csv python 
Python :: 2 numbers after comma python 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =