Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pathlib remove extension

>>> from pathlib import Path

>>> filename = Path('/some/path/somefile.txt')

>>> filename_wo_ext = filename.with_suffix('')

>>> print(filename)
/some/path/somefile.txt

>>> print(filename_wo_ext)
/some/path/somefile
Comment

PREVIOUS NEXT
Code Example
Python :: flask print to console 
Python :: list from comma separated string python 
Python :: python bar plot groupby 
Python :: python num2words installation 
Python :: scikit learn pca 
Python :: python how to delete a directory with files in it 
Python :: what is self in python 
Python :: django install 
Python :: try except python not working 
Python :: python pyqt5 
Python :: suppress python vs try/except pass 
Python :: python dict get random key 
Python :: tkinter button hide 
Python :: print type error python 
Python :: read excel spark 
Python :: google translator api pyhton 
Python :: django serialize foreign key, django serializer foreign key 
Python :: numpy randint 
Python :: cheat sheet python 
Python :: how to run same function on multiple threads in pyhton 
Python :: check if year is leap python 
Python :: voice translate python 
Python :: variable in python 
Python :: pandas column rank 
Python :: discord.py edit messages 
Python :: python thousands separators 
Python :: subtract number from each element in list python 
Python :: numpy rolling average 
Python :: pip install covid 
Python :: how to restart loop python 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =