If I have a filename like one of these:
1.1.1.1.1.jpg 1.1.jpg 1.jpg
How could I get only the filename, without the extension? Would a regex b
No need for regex. os.path.splitext is your friend:
os.path.splitext
os.path.splitext('1.1.1.jpg') >>> ('1.1.1', '.jpg')