Python. Iterate over a list of files, finding same filenames but different extensions
问题 So I have a list as follows: mylist = ['movie1.mp4','movie2.srt','movie1.srt','movie3.mp4','movie1.mp4'] Note: a simple list for testing, the script will deal with unknown file names and more of them. So I want to find the movie files with a paired srt file, and put those in a dictionary. Anything left (ie movie3.mp4) will be left in the list and dealt with later. I've been playing a bit with list comprehension, though it might not leave the leftover data and allow me to construct the