os.path.splitext is a command that divides the argument into before "." And after ".". It is used when extracting the extension of a file.
import os
print(os.path.splitext('sample.txt')
output
('sample', '.txt')
Recommended Posts