If my file has multiple extensions, such as
.stem only removes the last one. How do I remove all of them? Is this how I’m expected to do it:
from pathlib import Path filename = Path('file.tar.gz') while filename.suffix: filename = filename.with_suffix('')
It just seems a bit verbose.