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 :: python3 check if object has attribute 
Python :: webdriverwait python 
Python :: docker flask 
Python :: rename keys in dictionary python 
Python :: detailview 
Python :: vscode python multiline comment 
Python :: reset all weights keras 
Python :: django orm group by month and year 
Python :: create table pyspark sql 
Python :: flask set cookie 
Python :: pandas description of dataframe renaming column values 
Python :: extract all capital words dataframe 
Python :: print list in one line 
Python :: Publish Image msg ros python 
Python :: arrayfield django example 
Python :: how to host python flask web application 
Python :: python autoclicker 
Python :: python ssl 
Python :: get unique values from a list 
Python :: python: convert variable as character 
Python :: Example Layout using grid() in tkinter 
Python :: python list of dictionaries 
Python :: install google cloud python 
Python :: create a date list in postgresql 
Python :: how to input data to the list in pythion 
Python :: how does HTTPServer work in python 
Python :: python 2d dictionary 
Python :: python json to dict 
Python :: python regular expressions 
Python :: django filter by category 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =