python strip filename extension code example Example: strip file extension python import os print(os.path.splitext("/path/to/some/file.txt")[0])