i have a list with filenames. How do i use the os.path.splitext()
function to split the suffix and a filename and wirte it again into a list without the suffix.
import os
image_names = os.listdir('C:\Pictures\Sample Pictures')
newimageList = []
for name in image_names:
newimageList.append(name.os.path.splitext())
print(newList)
unfortunately the code don't work i get an Error: 'str' object has no attribute 'os'
if i had a new list(separeted in filename and suffix) i would skip every second element in a list to get just the filenames