Let's break down the problem a bit:
How do we get the names of files in a folder?
We're not going to care about the name, it's fine to get the full thing, just make sure you know how to list the files in a folder.
With a little research on how to list file names in a folder in Python, we get this:
#This line is crucial, as we will use some code from another library to helpus
import os
# This gives us a list of the names of all the files in the folder provided to the os.listdir() function
my_files = os.listdir("/path/to/folder")
# Now we can loop through and print each file name.
for file in my_files:
print(file)
How do we extract part of the name of the file?
This problem has nothing to with files really, but is rather about how to get a part of a string, so I'd recommend you read through the Python3 string documentation here. In particular, if the part you need from the name always comes before a -, then str.split() should help.
You can then apply the same logic to each file in the loop above.