Hi!
I generated a list that contains 3 text files
list = [path/A.txt, path/B.txt, path/C.txt]
Now, I want to remove the paths of the filenames, so that I have:
list = [A.txt, B.txt, C.txt]
I tried to use the os.path.basename() function in a for loop:
for file in list:
file = os.path.basename(file)
I know this does not work out and I have to adress the indices of the files in the list somehow, but I got stuck...
Can someone help me with this issue?
Greetings!
I generated a list that contains 3 text files
list = [path/A.txt, path/B.txt, path/C.txt]
Now, I want to remove the paths of the filenames, so that I have:
list = [A.txt, B.txt, C.txt]
I tried to use the os.path.basename() function in a for loop:
for file in list:
file = os.path.basename(file)
I know this does not work out and I have to adress the indices of the files in the list somehow, but I got stuck...
Can someone help me with this issue?
Greetings!